app/Http/Controllers/PriceListController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request) 
    {  
        $fields = [
            'name' =>'required|string|max:100',
        ];
        $message = ["required" => "El campo :attribute es requerido"];
        $this -> validate($request, $fields, $message);
         $listData = request()->except('_token');
        PriceList::insert($listData);  
        return redirect('/list/createList?role='.$request->role)->with('messageSuccess','Lista registrada con éxito');
    }
public function store ( Request $ request ) { $ fields = [ 'name' => 'required|string|max:100' , ] ; $ message = [ " required " => " El campo :attribute es requerido " ] ; $ this -> validate ( $ request , $ fields , $ message ) ; $ listData = request ( ) -> except ( '_token' ) ; PriceList :: insert ( $ listData ) ; return redirect ( '/list/createList?role=' . $ request -> role ) -> with ( 'messageSuccess' , 'Lista registrada con éxito') ; }
Store a newly created resource in storage.
Store a newly created resource in storage .