app/Http/Requests/StoreUpdateAluno.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        $id = $this->segment(2);
        return [
            'nome'=>"required|unique:alunos,nome,{$id},id",
            'dataMatricula'=>'required',
            'curso'=>'required',
            'turma'=>'required',
            'imagem'=>'image|max:2500',
            'CEP'=>'required',
            'cidade'=>'required',
            'estado'=>'required',
            'bairro'=>'required',
            'numero'=>'required',
            'complemento'=>'required',
            'rua'=>'required',
        ];
    }
public function rules ( ) { $ id = $ this -> segment ( 2 ) ; return [ 'nome' => " required|unique:alunos,nome, { $ id } ,id " , 'dataMatricula' => 'required' , 'curso' => 'required' , 'turma' => 'required' , 'imagem' => 'image|max:2500' , 'CEP' => 'required' , 'cidade' => 'required' , 'estado' => 'required' , 'bairro' => 'required' , 'numero' => 'required' , 'complemento' => 'required' , 'rua' => 'required' , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .