Open Simon-WebDev opened 6 years ago
Hi, there. I made ChatterDiscussionPolicy.
public function view(User $user, Discussion $discussion) { return Auth::user() && Auth::user()->id == $discussions->user_id | Auth::user() && Auth::user()->role_id == 1 ; }
and registered it. protected $policies = [
\DevDojo\Chatter\Models\Discussion::class => App\Policies\ChatterDiscussionPolicy::class, ];
I wrote $this->authorize('view',$discussion); in show method ChatterDiscussionController.php
Method [authorize] does not exist on [DevDojo\Chatter\Controllers\ChatterDiscussionController].
Hi, there. I made ChatterDiscussionPolicy.
public function view(User $user, Discussion $discussion) { return Auth::user() && Auth::user()->id == $discussions->user_id | Auth::user() && Auth::user()->role_id == 1 ; }
and registered it. protected $policies = [
I wrote $this->authorize('view',$discussion); in show method ChatterDiscussionController.php
Method [authorize] does not exist on [DevDojo\Chatter\Controllers\ChatterDiscussionController].