@extends('frontend.layouts.app') @section('content')
{{ trans('navs.general.home') }}
{{ trans('strings.frontend.welcome_to', ['place' => app_name()]) }}
@role('Administrator') {{-- You can also send through the Role ID --}}
{{ trans('strings.frontend.tests.based_on.role') . trans('strings.frontend.tests.using_blade_extensions') }}
{{ trans('strings.frontend.test') . ' 1: ' . trans('strings.frontend.tests.you_can_see_because', ['role' => trans('roles.administrator')]) }}
@endauth @if (access()->hasRole('Administrator'))
{{ trans('strings.frontend.tests.based_on.role') . trans('strings.frontend.tests.using_access_helper.role_name') }}
{{ trans('strings.frontend.test') . ' 2: ' . trans('strings.frontend.tests.you_can_see_because', ['role' => trans('roles.administrator')]) }}
@endif @if (access()->hasRole(1))
{{ trans('strings.frontend.tests.based_on.role') . trans('strings.frontend.tests.using_access_helper.role_id') }}
{{ trans('strings.frontend.test') . ' 3: ' . trans('strings.frontend.tests.you_can_see_because', ['role' => trans('roles.administrator')]) }}
@endif @if (access()->hasRoles(['Administrator', 1]))
{{ trans('strings.frontend.tests.based_on.role') . trans('strings.frontend.tests.using_access_helper.array_roles_not') }}
{{ trans('strings.frontend.test') . ' 4: ' . trans('strings.frontend.tests.you_can_see_because', ['role' => trans('roles.administrator')]) }}
@endif {{-- The second parameter says the user must have all the roles specified. Administrator does not have the role with an id of 2, so this will not show. --}} @if (access()->hasRoles(['Administrator', 2], true))
{{ trans('strings.frontend.tests.based_on.role') . trans('strings.frontend.tests.using_access_helper.array_roles') }}
{{ trans('strings.frontend.tests.you_can_see_because', ['role' => trans('roles.administrator')]) }}
@endif @permission('view-backend')
{{ trans('strings.frontend.tests.based_on.permission') . trans('strings.frontend.tests.using_access_helper.permission_name') }}
{{ trans('strings.frontend.test') . ' 5: ' . trans('strings.frontend.tests.you_can_see_because_permission', ['permission' => 'view-backend']) }}
@endauth @if (access()->hasPermission(1))
{{ trans('strings.frontend.tests.based_on.permission') . trans('strings.frontend.tests.using_access_helper.permission_id') }}
{{ trans('strings.frontend.test') . ' 6: ' . trans('strings.frontend.tests.you_can_see_because_permission', ['permission' => 'view_backend']) }}
@endif @if (access()->hasPermissions(['view-backend', 1]))
{{ trans('strings.frontend.tests.based_on.permission') . trans('strings.frontend.tests.using_access_helper.array_permissions_not') }}
{{ trans('strings.frontend.test') . ' 7: ' . trans('strings.frontend.tests.you_can_see_because_permission', ['permission' => 'view_backend']) }}
@endif @if (access()->hasPermissions(['view-backend', 2], true))
{{ trans('strings.frontend.tests.based_on.permission') . trans('strings.frontend.tests.using_access_helper.array_permissions') }}
{{ trans('strings.frontend.tests.you_can_see_because_permission', ['permission' => 'view_backend']) }}
@endif
Bootstrap Glyphicon {{ trans('strings.frontend.test') }}
Font Awesome {{ trans('strings.frontend.test') }}
@endsection