EscolaLMS/Auth

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

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace EscolaLms\Auth\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;

class InitProfileDeletionRequest extends FormRequest
{
    public function authorize(): bool
    {
        return Gate::allows('delete', $this->user());
    }

    public function rules(): array
    {
        return [
            'return_url' => ['required', 'string'],
        ];
    }

    public function getReturnUrl(): ?string
    {
        return $this->input('return_url');
    }
}