Skip to content

Commit

Permalink
Fixed formatting for Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
soumen-dey authored Jun 10, 2018
1 parent 753a30c commit 48f2266
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,21 +400,21 @@ use Illuminate\Support\Facades\Blade;

public function boot()
{
// ..
// ..

Blade::if('role', function ($rolename) {
return auth()->check() && auth()->user()->is($rolename);
});
Blade::if('role', function ($rolename) {
return auth()->check() && auth()->user()->is($rolename);
});
}
```

You can now use the directive:

``` php
@role('admin')
The user is an admin!
The user is an admin!
@else
The user is not an admin!
The user is not an admin!
@endrole
```

Expand All @@ -425,31 +425,31 @@ use Illuminate\Support\Facades\Blade;

public function boot()
{
// ..
// ..

Blade::if('admin', function () {
return auth()->check() && auth()->user()->is('admin');
});
Blade::if('admin', function () {
return auth()->check() && auth()->user()->is('admin');
});
}
```

You can now use the directive:

``` php
@admin
The user is an admin!
The user is an admin!
@else
The user is not an admin!
The user is not an admin!
@endadmin
```

Or if you don't want any custom directive, you can do:

``` php
@if(auth()->user()->is('admin'))
The user is an admin!
The user is an admin!
@else
The user is not an admin!
The user is not an admin!
@endif
```

Expand Down

0 comments on commit 48f2266

Please sign in to comment.