You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
500 B
27 lines
500 B
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Entities\Users\User;
|
|
use App\Entities\Users\Event;
|
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
|
|
|
/**
|
|
* Event model policy class.
|
|
*
|
|
* @author Nafies Luthfi <nafiesL@gmail.com>
|
|
*/
|
|
class EventPolicy
|
|
{
|
|
use HandlesAuthorization;
|
|
|
|
public function update(User $user, Event $event)
|
|
{
|
|
return $user->id == $event->user_id;
|
|
}
|
|
|
|
public function delete(User $user, Event $event)
|
|
{
|
|
return $user->id == $event->user_id;
|
|
}
|
|
}
|