towhid
4 months ago
122
10
Laravel

want to disable this method in form request validation file

Posted 4 months ago by towhid

this is my form request validation after add this validation rules and message and authorize i face one error how to solve

//this is my form request validation  code

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ProjectCreate extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => ['required','unique:projects'],
            'description' => ['required'],
        ];
    }

    public function messages()
    {
        return [
            'title.required' => 'A title is required mustbe ,please fill up the message',
            'title.required' => 'A description khub dorkar',
        ];
    }
}

show this error

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_RECOVERABLE_ERROR)
Too few arguments to function App\Http\Requests\ProjectCreate::Illuminate\Foundation\Providers\{closure}(), 0 passed and exactly 1 expected

Please sign in or create an account to participate in this conversation.