lundi 26 mars 2018

Type error: Argument 2 passed to with() must be callable or null, object given

Route::get('/',function (){
    $collection = collect(['product'=>'chair','price'=>100]);    
    //dd($collection);
    return view('welcome')-with('prices',$collection);
});

I want to pass $collection on view but I get this error:

Type error: Argument 2 passed to with() must be callable or null,

object given

and I don't understand why.

Can somebody explain me?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire