feat: add comments for controller and model and blade for dashboard for user
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CommentPostRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'commentable_id' => 'required|integer',
|
||||
'commentable_type' => 'required|string|in:tour,flight',
|
||||
'body' => 'required|string|max:1000',
|
||||
];
|
||||
|
||||
if (!auth()->check()) {
|
||||
$rules['guest_name'] = 'required|string|max:150';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user