<?php

namespace App\Traits\Authorization;

trait WithAuthorization
{
    public function canOrAbort(string $ability, $model = null): void
    {
        if (auth()->user()->cannot($ability, $model)) {
            abort(403);
        }
    }
}
