How to connect Laravel styles

Laravel styling simplified: Learn how to get up & running with styles in no time, with an example.

Connecting Laravel Styles

Connecting Laravel styles is a relatively straightforward process that involves a few steps. To begin, you will need to add the following line of code to your main application file, typically located in the app/config directory:


// Include the Laravel styles
app()->make('styles')->add('laravel', public_path().'/css/laravel.css');

This code will allow your application to recognize the new Laravel styles. Next, you will need to add the following line of code to the page where you would like to use the new styles:


// Include the Laravel styles
@styles('laravel')

This code will tell the application to include the new Laravel styles on the page. Finally, you will need to add the following line of code to the bottom of the page, just before the closing tag:


// Include the Laravel styles
@styles()

This code will tell the application to actually render the styles on the page. By following these steps, you can easily connect your Laravel application with the new styles.

Answers (0)