app/Http/Requests/TurnRequest.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()
    {
        return [
            'tile_id' => [
                'required',
                'integer',
                new MustNotHaveAWinner($this->game),
                'exists:tiles,id',
                new MustBeUsersTurn($this->game, $this->user()),
                new MustHaveInHand($this->game, $this->user()),
            ],
            'side' => ['required', 'string', 'in:left,right',   new TileMustHaveOneOfTheNumbers($this->game, $this->tile_id)]
        ];
    }
public function rules ( ) { return [ 'tile_id' => [ 'required' , 'integer' , new MustNotHaveAWinner ( $ this -> game ) , 'exists:tiles,id' , new MustBeUsersTurn ( $ this -> game , $ this -> user ( ) ) , new MustHaveInHand ( $ this -> game , $ this -> user ( ) ) , ] , 'side' => [ 'required' , 'string' , 'in:left,right' , new TileMustHaveOneOfTheNumbers ( $ this -> game , $ this -> tile_id ) ] ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .