How to get data from database to view page in laravel?

aymanalhattami 2021-12-05 21:16:41
2021-12-05 07:38:34
how to fix laravel_session not match to csrf token?

it at first you need to include @csrf in your form

Zoxedelfless 2021-12-05 21:48:07
creating directories in laravel ?
Priya Govindaraj 2021-12-05 22:03:25
How to retrive data stored in array and display in blade view using laravel
Priya Govindaraj 2021-12-05 22:06:59
One user having more habbies. Here how we display every user infm with habbies
Shiv_95 2021-12-05 22:07:31
Send that data to the blade view and loop through it
Shiv_95 2021-12-05 22:07:44
In the view files tble
Shiv_95 2021-12-05 22:10:11
return view(‘welcome’, [‘data’ =>$array]);
Shiv_95 2021-12-05 22:10:27
Like this you can pass the array to the blade view
Priya Govindaraj 2021-12-05 22:12:03
Sir any example code is available?
Shiv_95 2021-12-05 22:13:33

How to get data from database to view page in laravel?Stack Overflow
I am using Laravel 5.4 and I want to view my data in database from my view page (listpetani.blade.php).

Here is the code of my project:


<div class=”table-responsive”>
<table cla…

Priya Govindaraj 2021-12-05 22:18:52
In my code I using 2db tables
Shiv_95 2021-12-05 22:19:43
Two tables from same database?
Priya Govindaraj 2021-12-05 22:20:50
In user table stores all information id name etc and another table named user hobbies id, user id foreign key, hobbies
Shiv_95 2021-12-05 22:21:06
Use join then
Shiv_95 2021-12-05 22:21:31
Join those both table and you will get single combined array from both table
Priya Govindaraj 2021-12-05 22:21:32
I used eloquent
Shiv_95 2021-12-05 22:24:23
Then it’s good
Shiv_95 2021-12-05 22:24:39
What’s the problem?
Shiv_95 2021-12-05 22:25:03
Define the relationship in model has many
Shiv_95 2021-12-05 22:26:25

Shiv_95 2021-12-05 22:26:26

Shiv_95 2021-12-05 22:27:24
Here posts will be your users table and and comments will be hobbies table
Shiv_95 2021-12-05 22:27:34
Try this it should work
Priya Govindaraj 2021-12-05 22:28:25
Ok sure thank u sir
Priya Govindaraj 2021-12-05 22:29:09
Another 2 different doubts also I have..
Priya Govindaraj 2021-12-05 22:30:21
How to retrive uploaded image stored in media table using spatie laravel medialibrary
Priya Govindaraj 2021-12-05 22:33:04
In view file has a card each user have their corredponding image na… Then I give <img src=getFirstMediaUrl() “>
Priya Govindaraj 2021-12-05 22:33:23
It shows an error
hardik 2021-12-05 23:12:31
Stop learning laravel, try node
hardik 2021-12-05 23:12:44
Flexible and fast
hardik 2021-12-05 23:14:56
easy too
suuwhooop 2021-12-05 23:31:03
I believe opinions are subjective my friend
Oluwaseyi000 2021-12-06 00:38:58
hardik 2021-12-05 23:12:31
Stop learning laravel, try node

Node is unopinated which to me is a curse, most newbies will spend more time looking for and testing different packages than they will use coding client work

Hazar_Orabi 2021-12-06 01:28:23
I want artical about api multi auth in jwt
neelbas 2021-12-06 01:34:23
Hi, I have Bill model, it has Many BillLines and each BillLine has one-to-one relation to Products
so BillLine table has bill_id, product_id colums as foreign keys.
How I can get a Bill with it’s BillLines contains Product ?

I tried (from Bill model) :
public function products(): HasManyThrough {
return $this->hasManyThrough(Product::class, BillLine::class);
but it throw error which mean ‘products.bill_line_id’ is require, but in my design the product table can’t be contains bill_line column!