EscolaLMS/Auth

View on GitHub
src/Http/Requests/ImpersonateRequest.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace EscolaLms\Auth\Http\Requests;

use EscolaLms\Auth\Models\User;

class ImpersonateRequest extends ExtendableRequest
{
    public function authorize(): bool
    {
        return $this->user()->can('impersonate', User::class);
    }

    public function rules(): array
    {
        return [
            'user_id' => ['required', 'integer', 'exists:users,id'],
        ];
    }
}