I'm trying to use @cannot in my template but I have the following issue. With the code:
@section('content')
@can('upload-images',$flyer)
<form action="{{ URL::to('/') }}/{{ $flyer->zip }}/{{ $flyer->street }}/photos" method="POST" class="dropzone" enctype="multipart/form-data">
{{ csrf_field() }}
</form>
@endcan
@cannot
<p>Not allowed</p>
@endcannot
@stop
@cannot throws the following error:
Undefined class constant 'denies'
I know @cannot exists and also that uses Gate::denies, which is the error I'm taking, here is the Github commit where the magic should occur:
https://github.com/laravel/framework/commit/9c41aa0d53412e3008285e89ff9764fa51b42469
Any clues? Thanks!
Laravel's doc has being updated. I should use @else:
@can(...)
@else
@endcan
And @cannot should be used as the opposite of @can, but never at the same time:
@cannot(...)
@else
@endcannot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With