Commit workspace changes
This commit is contained in:
29
app/Http/Requests/Groups/StoreGroupAssetRequest.php
Normal file
29
app/Http/Requests/Groups/StoreGroupAssetRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Requests\Groups;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreGroupAssetRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user() !== null;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'title' => ['required', 'string', 'min:2', 'max:180'],
|
||||
'description' => ['nullable', 'string', 'max:40000'],
|
||||
'category' => ['nullable', 'in:' . implode(',', (array) config('groups.assets.categories', []))],
|
||||
'visibility' => ['nullable', 'in:' . implode(',', (array) config('groups.assets.visibility_options', []))],
|
||||
'status' => ['nullable', 'in:' . implode(',', (array) config('groups.assets.statuses', []))],
|
||||
'linked_project_id' => ['nullable', 'integer'],
|
||||
'is_featured' => ['nullable', 'boolean'],
|
||||
'file' => ['required', 'file', 'mimes:' . implode(',', (array) config('groups.assets.allowed_extensions', [])), 'max:' . (int) config('groups.assets.max_upload_kb', 20480)],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user