24 lines
370 B
PHP
24 lines
370 B
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\Bot;
|
|
use App\Models\User;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class BotPolicy
|
|
{
|
|
/**
|
|
* Create a new policy instance.
|
|
*/
|
|
public function __construct()
|
|
{
|
|
return Auth::check();
|
|
}
|
|
|
|
public function view(User $user, Bot $bot): bool
|
|
{
|
|
return $user->id === $bot->user_id;
|
|
}
|
|
}
|