How can I store an area in MySQL?

|
foulla_sam 2021-01-19 23:32:38
Hello everyone, I need help.
I have a belongsTo relationship that doesn’t work when I use author but work when I use user instead
Here is my Post model
foulla_sam 2021-01-19 23:33:08
laravel_discuss-67081.jpg

foulla_sam 2021-01-19 23:34:03
It show me null in result when I try to get all with relation
foulla_sam 2021-01-19 23:34:30
laravel_discuss-67083.jpg

Abbas_roholamin 2021-01-19 23:35:57
add foreign key and local key🙄
Siberfx 2021-01-19 23:58:42
Yeah as long as the relation column and model name different…
foulla_sam 2021-01-20 00:07:34
Thanks, solved
sohilstha 2021-01-20 00:18:09
sohilstha 2021-01-19 21:11:07

need help guys

Siberfx 2021-01-20 00:18:48
about?
RahiMSuleymaN 2021-01-20 00:20:09
laravel_discuss-67090.jpg

RahiMSuleymaN 2021-01-20 00:20:28
laravel_discuss-67091.jpg

sohilstha 2021-01-20 00:20:55
Siberfx 2021-01-20 00:18:48
about?

laravel_discuss-67093.jpg
Id random number

RahiMSuleymaN 2021-01-20 00:20:55
laravel_discuss-67092.jpg

sohilstha 2021-01-20 00:20:56
Siberfx 2021-01-20 00:18:48
about?

laravel_discuss-67095.jpg

sohilstha 2021-01-20 00:20:56
Siberfx 2021-01-20 00:18:48
about?

laravel_discuss-67094.jpg

RahiMSuleymaN 2021-01-20 00:21:30
laravel_discuss-67096.jpg

RahiMSuleymaN 2021-01-20 00:21:45
why with not working
Siberfx 2021-01-20 00:24:14
relations also empty ?
Djuraev_Oybek 2021-01-20 00:26:03
how to fetch the last record from the database
DesolatorMagno 2021-01-20 00:26:23
sohilstha 2021-01-20 00:20:56

Is not a random number, it could be there was a problem while trying to save into database so it just skip that number.

sohilstha 2021-01-20 00:27:55
DesolatorMagno 2021-01-20 00:26:23
Is not a random number, it could be there was a problem while trying to save into database so it just skip that number.

laravel_discuss-67103.jpg
but there is id in database

DesolatorMagno 2021-01-20 00:28:30
That is the order of the fields..
Siberfx 2021-01-20 00:28:33
Djuraev_Oybek 2021-01-20 00:26:03
how to fetch the last record from the database

from a table? you can use Model::orderBy(‘id’, ‘desc’)->first();
or
Model::latest(‘id’)->first();

DesolatorMagno 2021-01-20 00:29:42
ID is autogenerated, if you delete or there is a error while trying to save it will not use that number anymore.
profsr123 2021-01-20 08:10:45
“varient”:”nkkk”,”oldprice”:”150″,”newprice”:”1323″,”varient00″:”nkkk32132″,”oldprice00″:”150″,”newprice00″:”1323″,”varient0″:”45551″,”oldprice0″:”1502121″,”newprice0″:”1323
profsr123 2021-01-20 08:11:16
this is what i am getting in post request in controller
profsr123 2021-01-20 08:11:41
i want to store this in a table
profsr123 2021-01-20 08:11:59
how?
profsr123 2021-01-20 08:14:16
anybody please help
justine_chacko 2021-01-20 08:37:33
profsr123 2021-01-20 08:11:41
i want to store this in a table

$data = request()->validate([
….
]);
Model::create($data);

2021-01-20 08:47:31
How can I store an area in MySQL?
2021-01-20 08:49:54
Do you think it’s creaze to make a full world map using PHP and MySQL? That’s what I’m trying to do.
hypernxf 2021-01-20 09:29:49
it’s not crazy
hypernxf 2021-01-20 09:30:04
But you do need to know how to MySQL store geometric data though
Prem Soni 2021-01-20 09:37:13
If anyone have work in laravel than dm me
|