0.1: replace Request with FormRequest in all controllers
This commit is contained in:
1 parent
ffafcf447b
commit
f3568ab277
15 files changed
+277
-107
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Blog;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateCategoryRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
$categoryId = $this->route('category');
|
||||
|
||||
return [
|
||||
'name' => 'sometimes|required|string|max:255|unique:categories,name,' . $categoryId,
|
||||
'slug' => 'sometimes|required|string|unique:categories,slug,' . $categoryId,
|
||||
'description' => 'sometimes|required|string',
|
||||
'short_description' => 'nullable|string|max:500',
|
||||
'image' => 'nullable|url',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user