awesome video this method is working properly, but me personally will take Soft Delete way to keep the user in DB for history purpose instead of disable the delete
Hi, good video! I noticed that you use a mac for programming. Is it a version with m1 chip? What tools do you use to program locally in Laravel? Thank you!
Good question, it depends on what you want to return and how. I guess the best way would be try-catch and then in exception return validation exception with code 422, or error message with code 400 or 500.
I fill tables from an api and I've created foreigns to parent and grandparent but it gave me soo many errors on the parent relation that I just had to remove that relation. These foreign key constraints can be a huge headache sometimes.
Nice tips as usual. How do you add something like "updated_by" foreign key? Example: posts (table) id body user_id (Foreign key related to user) update_by (Another foreign key related to user)
public function user() { return $this->belongsTo(User::class, 'user_id'); } public function updated_by() { return $this->belongsTo(User::class, 'updated_by_user_id'); }
it is easy if we have single relation. if there are more relations code will become messy, I have tried using an isDeletable function on the model and checking for all relation counts in that function. Any better approach for this?
@@LaravelDaily Hello dear teacher) Is it possible to make dynamic filtering for products (I mean by many characteristics that defined by admin which we don't know), I've alreay seen your Laravel-Vue-Sidebar-Filters project
@@nurbolatnurlanuly I'm not a big fan of making some script of filtering for DYNAMIC characteristics which are not known upfront, because each characteristic may have its own different behavior and then that filtering would break.
The amount of knowledge you provided me for my work and studies is priceless. Thanks a lot!
Man I love your videos, so glad I've found your channel just now 👍👍👍
thanks sir. Greetings From Java Island
You are LEGEND, That's it.
It was for me a gap filling video. Thanks again.
Thanks for the informative video🙂
short and concise, thank you!
Very informative. Keep up your great work!
Thank you sir. It helps me a lot ❤️ i had an issue of this error.
Now its fine now ❤️❤️
awesome video
this method is working properly, but me personally will take Soft Delete way to keep the user in DB for history purpose instead of disable the delete
Nice one 👍
But i prefer to soft delete functionality, if it's a master data...
thanks for the amazing content!
Thank you so much sir
Hi, good video! I noticed that you use a mac for programming. Is it a version with m1 chip? What tools do you use to program locally in Laravel? Thank you!
thanks man thats help a lot ..
thank you very much
thanks sir.
Great one, thanks for this beauty
How do you you return this error, when dealing with API?
Good question, it depends on what you want to return and how. I guess the best way would be try-catch and then in exception return validation exception with code 422, or error message with code 400 or 500.
@@LaravelDaily thanks for the clarification 🙂
GREAT video actually!!
Thank you! :)
I fill tables from an api and I've created foreigns to parent and grandparent but it gave me soo many errors on the parent relation that I just had to remove that relation.
These foreign key constraints can be a huge headache sometimes.
Please record video with categories and subcategories with view and dynamic route. Single view with boxes as link to subcategories
Nice tips as usual. How do you add something like "updated_by" foreign key?
Example: posts (table)
id
body
user_id (Foreign key related to user)
update_by (Another foreign key related to user)
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
public function updated_by()
{
return $this->belongsTo(User::class, 'updated_by_user_id');
}
@@LaravelDaily why updated_by_user_id instead of updated_by?
Hi can you pls let me know about the Cors error. I have installed the fruitcake pkg for cors but it does not work. Can you pls help me out
it is easy if we have single relation. if there are more relations code will become messy, I have tried using an isDeletable function on the model and checking for all relation counts in that function. Any better approach for this?
It depends on the situation, with more relations there's no one way to un-mess the code :)
Thanks, plz make a video on count() error in different php version
count() error? What do you mean exactly?
@@LaravelDaily Hello dear teacher) Is it possible to make dynamic filtering for products (I mean by many characteristics that defined by admin which we don't know), I've alreay seen your Laravel-Vue-Sidebar-Filters project
@@nurbolatnurlanuly I'm not a big fan of making some script of filtering for DYNAMIC characteristics which are not known upfront, because each characteristic may have its own different behavior and then that filtering would break.
The code in the controller doesn't look neat enough, you can use "Policies".
Yes, the code itself is from one of my student junior developers, I didn't comment on that part of the code, only the deleting part.