Just one thing is it different on performance?

|
DesolatorMagno 2020-06-18 17:02:58
Dude, did you notice that you are creating a modal for each elemnt, and every modal have the same ID?
DesolatorMagno 2020-06-18 17:04:38
So when you click what happen? It call the first modal with that name…
ForeingNavarro 2020-06-18 17:04:47
the modal must be out of the foreach?
DesolatorMagno 2020-06-18 17:04:48
Name/id
DesolatorMagno 2020-06-18 17:05:42
If you want to use the modal you are gonna need to use JS.
DesolatorMagno 2020-06-18 17:09:42
There is a work around for it, but still creating 1 modal for each item is bad.
nachtpanda 2020-06-18 17:21:28
route model binding?
kevin7G 2020-06-18 18:03:26
laravel_discuss-42097.jpg
i am getting this error..pls help
RajkotRocks 2020-06-18 18:58:35
kevin7G 2020-06-18 18:03:26
i am getting this error..pls help

Issue with foreign key please recheck

fajarrosi 2020-06-18 19:09:03
kevin7G 2020-06-18 18:03:26
i am getting this error..pls help

foreign key is incorrect

2020-06-18 21:02:56
Invalid command ‘WriteEngine’, perhaps misspelled or defined by a module not included in the server configuration, referer: http://lianxi-hsk.com/

Iā€™m getting this error after Upload laravel project into cpanel,

2020-06-18 21:03:07
Pls help…
kevin7G 2020-06-18 21:13:23
RajkotRocks 2020-06-18 18:58:35
Issue with foreign key please recheck

i m not get it..

ibra_br 2020-06-18 21:14:05
can anyone suggest me any website contain Laravel exercises
S3NX_8 2020-06-18 21:14:28
Find(1) ia not working ?
battleplayer 2020-06-18 21:54:31
how can i get last inserted id in laravel
e3ximroot 2020-06-18 22:30:11
battleplayer 2020-06-18 21:54:31
how can i get last inserted id in laravel

$id = mymodel::count() -1;

e3ximroot 2020-06-18 22:31:10
e3ximroot 2020-06-18 22:30:11
$id = mymodel::count() -1;

cz count return number of records in this table start counting from 1

e3ximroot 2020-06-18 22:31:45
e3ximroot 2020-06-18 22:30:11
$id = mymodel::count() -1;

* edit
$last_id= $model::count();

e3ximroot 2020-06-18 22:32:57
ibra_br 2020-06-18 21:14:05
can anyone suggest me any website contain Laravel exercises

make your own project

DesolatorMagno 2020-06-18 23:40:51
e3ximroot 2020-06-18 22:31:45
* edit
$last_id= $model::count();

If you delet a record in database that number will be wrong.

DesolatorMagno 2020-06-18 23:41:18
laravel_discuss-42118.jpg
Here is a way to do it.
amirAutomationEnginner 2020-06-18 23:43:27
You csn use ftom comnand last insertedId
DesolatorMagno 2020-06-18 23:47:26
laravel_discuss-42120.jpg
this lastInsertId ?
amirAutomationEnginner 2020-06-18 23:50:47
DesolatorMagno 2020-06-18 23:47:26
this lastInsertId ?

Yes

suhailpallimalil 2020-06-19 00:02:54
e3ximroot 2020-06-18 22:30:11
$id = mymodel::count() -1;

Bad idea!

suhailpallimalil 2020-06-19 00:03:17
There is a function avail to get last inserted id
suhailpallimalil 2020-06-19 00:05:21
Refer šŸ‘‡šŸ¼
suhailpallimalil 2020-06-19 00:05:35
https://hdtuto.com/article/how-to-get-last-inserted-id-in-laravel-57

How to get last inserted id in Laravel 7.x and 6.x? – HDTuto.comHdtuto
laravel 5.7 get last insert id, laravel 5.7 db last insert id, get current inserted id in laravel 5.7, get saved id in laravel 5.7, save () and get id laravel 5.7, get id of new record laravel 5.7, get last inserted id laravel 5.7 query builder
DesolatorMagno 2020-06-19 00:07:42
If what you want to get is the id of the row that was just inserted, yes those are the best options
DesolatorMagno 2020-06-19 00:08:18
battleplayer 2020-06-18 21:54:31
how can i get last inserted id in laravel

But, the requeriment here well could be to get the last id, not the id of the just created/inserted.

MohamedGamalJi 2020-06-19 00:09:37
laravel_discuss-42128.jpg

DesolatorMagno 2020-06-19 00:19:41
Yeah, is a bad idea to show a list with User::all() with no pagination for a app with 100k users, but for a 5 user intranet app, it is not. We are not getting paid to just write code.
Siberfx 2020-06-19 00:26:51
DesolatorMagno 2020-06-19 00:19:41
Yeah, is a bad idea to show a list with User::all() with no pagination for a app with 100k users, but for a 5 user intranet app, it is not. We are not getting paid to just write code.

as long as there are big data, cursor() is pretty cool. lazy collection

Siberfx 2020-06-19 00:27:02
šŸ™‚ just FYI
DesolatorMagno 2020-06-19 00:27:18
Yeah
Acird Burn 2020-06-19 00:28:29
Need some help anyone online
suhailpallimalil 2020-06-19 00:31:21
DesolatorMagno 2020-06-19 00:08:18
But, the requeriment here well could be to get the last id, not the id of the just created/inserted.

Ohh ya . My bad.

suhailpallimalil 2020-06-19 00:34:58
In my previous project , there is a purchase order table and i wanted to keep a incrementing number for purchase invoice number. Where i wanted to take the last inserted id. What i have done is order by the column and took the first one by limit 1.
DesolatorMagno 2020-06-19 00:36:00
you know autoincrement is a thing, right?
suhailpallimalil 2020-06-19 00:38:29
I used separate column for this number.
Roham0010 2020-06-19 02:43:10
e3ximroot 2020-06-18 22:30:11
$id = mymodel::count() -1;

Whay if we had a deleted row?

Roham0010 2020-06-19 02:44:38
DesolatorMagno 2020-06-18 23:41:18
Here is a way to do it.

->latest() is nicer than orderby šŸ˜

DesolatorMagno 2020-06-19 02:45:52
laravel_discuss-42141.jpg
Yes, but as side note, they are not exactly the same thing.
Roham0010 2020-06-19 02:47:40
battleplayer 2020-06-18 21:54:31
how can i get last inserted id in laravel

Just one another thing about this, If you are using create to insert new data it will return you the whole new row with id

Roham0010 2020-06-19 02:49:48
DesolatorMagno 2020-06-19 02:45:52
Yes, but as side note, they are not exactly the same thing.

Yes but both Id and created_at get filled with laravel so this will be always true in both solutions
Just one thing is it different on performance? I mean time of executing the query..

DesolatorMagno 2020-06-19 02:53:24
I did say not exactly the same, but, latest also work for uuid, but for id work when you insert.
skys215 2020-06-19 04:50:36
Sorry, English group
ibra_br 2020-06-19 07:44:09
laravel_discuss-42150.jpg
guys , how can i solve this problem ?
2020-06-19 07:45:15
Install node-v13.3.0 first
|