laravel-learn-bbs/app/Policies/TopicPolicy.php

20 lines
329 B
PHP

<?php
namespace App\Policies;
use App\Models\Topic;
use App\Models\User;
class TopicPolicy extends Policy
{
public function update(User $user, Topic $topic)
{
return $user->isAuthorOf($topic);
}
public function destroy(User $user, Topic $topic)
{
return $user->isAuthorOf($topic);
}
}