#is it possible to pass data from the db via routes and blade? no controller

13 messages · Page 1 of 1 (latest)

hazy nimbus
#

return view('table', $data);
it should be return view('table', ['data'=>$data]);

hazy nimbus
#

as the error mentioned, it is an array, not object

#

probably you should access the value by $data['testament'] instead

#

but the thing is, the data is an empty array, so I don't think you will able to access the value as well

torn shard
#

I see, well thank you for your input. On another page I've got this table actually populates already with data. I was trying to create a new page to see if I could essentially create the table myself and populate the data from the db.

#

I was glancing over the documentation link you you sent, and perhaps there is a way to pass the data in a different way

#

Blade's @include directive allows you to include a Blade view from within another view. All variables that are available to the parent view will be made available to the included view:

hazy nimbus
#

and perhaps there is a way to pass the data in a different way
If you are saying,

  1. Click a link
  2. redirect to new page
  3. populate the data
torn shard
#

Yes that would be nice, also sent you a private message with a snapshot.

hazy nimbus