laravel-learn-bbs/app/Policies/TopicPolicy.php
2018-01-01 16:32:20 +08:00

20 lines
311 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 $topic->user_id == $user->id;
}
public function destroy(User $user, Topic $topic)
{
return true;
}
}