forge/app/Http/Requests/ModRequest.php

34 lines
748 B
PHP
Raw Normal View History

2024-05-15 00:31:24 -04:00
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ModRequest extends FormRequest
{
2024-09-12 13:19:52 -04:00
/**
* Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/
2024-05-15 00:31:24 -04:00
public function rules(): array
{
return [
'user_id' => ['required', 'exists:users'],
'name' => ['required'],
'slug' => ['required'],
'description' => ['required'],
'license_id' => ['required', 'exists:licenses'],
'source_code_link' => ['required'],
];
}
2024-09-12 13:19:52 -04:00
/**
* Determine if the user is authorized to make this request.
*/
2024-05-15 00:31:24 -04:00
public function authorize(): bool
{
return true;
}
}