rtmatt/body-class

quick browser body class service provider for laravel 5

1.0.1 2016-02-03 18:42 UTC

This package is not auto-updated.

Last update: 2024-04-13 16:07:14 UTC


README

Laravel Service provider built around Agent to add browser classes to the body HTML tag.

Installation

Install using composer:

$ composer require rtmatt/body-class

Add service provider to config/app.php

Rtmatt\BodyClass\BodyClassServiceProvider::class

Usage

This requires your layout file to be /resources/views/layouts/main.blade.php. Support for multiple or other layouts may come in the future.

In file mentioned above, add the following to your body tag:

<body{!! ($body_class) ? ' class="'.$body_class.'"' : '' !!}>

You are good to go!