platform/admin/app/Http/Requests/UpdateEvent.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 [
            'name' => ['required', 'string'],
            'slug' => ['required', 'string', Rule::unique('events')->where(function ($query) {
                $query->where('organizer_id', \Auth::id())
                    ->where('id', '<>', $this->event);
            }), 'regex:/^[a-z0-9-]+(?:[a-z0-9]+)*$/'],
            'date' => ['required', 'date_format:d/m/Y H:i'],
            'address' => ['required', 'string', 'min:10'],
            'thumbnail' => ['nullable', 'file', 'image', 'mimes:jpg,png,jpeg,svg'],
            'description' => 'nullable|string'
        ];
    }
public function rules ( ) { return [ 'name' => [ 'required' , 'string' ] , 'slug' => [ 'required' , 'string' , Rule :: unique ( 'events' ) -> where ( function ( $ query ) { $ query -> where ( 'organizer_id' , \ Auth :: id ( ) ) -> where ( 'id' , '<>' , $ this -> event ) ; } ) , 'regex:/^[a-z0-9-]+(?:[a-z0-9]+)*$/' ] , 'date' => [ 'required' , 'date_format:d/m/Y H:i' ] , 'address' => [ 'required' , 'string' , 'min:10' ] , 'thumbnail' => [ 'nullable' , 'file' , 'image' , 'mimes:jpg,png,jpeg,svg' ] , 'description' => 'nullable|string' ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .