ldc-mesbr-app/app/Http/Requests/Campaign/ShowDemoCampaign.php
2025-11-07 11:08:02 +01:00

32 lines
682 B
PHP

<?php
namespace App\Http\Requests\Campaign;
use App\Enums\UserRoles;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class ShowDemoCampaign extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return Auth::check() && (Auth::user()->roles === UserRoles::superadmin()->value || Auth::user()->roles === UserRoles::admin()->value);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}