Laravel Custom Fields with Trait: Crater Example

preview_player
Показать описание
Let's take a look at one example of implementing Eloquent custom fields, with a Trait to be re-used in multiple Models.

Links mentioned in the video:

- - - - -
Support the channel by checking out my products:

- - - - -
Other places to follow:
Рекомендации по теме
Комментарии
Автор

Not going deep into the details is ok. The best part about your daily videos is that we always come up with new things and most of the time it is very helpful for us as a developer to get an idea about different things or new features that laravel releases.

imranafzal
Автор

I used 3 tables - object_property_values, which includes - object_id, property_id, value_id, properties - id, label, values - id, value. Which is simplier and easier to optimize it.

Leopandor
Автор

This is a bit more well known as the EAV pattern. Entity Attribute Value.
Really really rough on your database, but nice if you have an app where you want non-technical members adding custom fields.

Though these days I'd rather build something with a json blob than do this via a Morph relationship tbh

JohnRoux
Автор

I think shooting video about others' code is OK for not beginners. It might be hard to follow them. I think it would have been better to have more details about this implementation and use cases of custom fields. Thanks.

bulent
Автор

Pls, do u mind creating a video on async in Laravel, I mean asynchronous

foodarena
Автор

By the way,
What are the solutions to whereby your livewire works well on your local machines but doesn't work when deployed to live environment

ngetichishmael
Автор

This solution offers maximum flexibility but, performance wise it is a nightmare and i don't recommand it at all (unless you have a very small database)
You better come up with a solution that stores the custom fields structure and applies "alter table" actions to actually have the custom fields within the physical table. But this solution is more difficult to implement and requires writing some custom SQL generated on the fly to read and write the data from and to the database.

FISS
Автор

I think that your table has too much columns.

Leopandor
Автор

I have a question. If PHP is free, Mysql is free and Laravel is free then why your courses are paid?
Is education for rich people only? 😋

AhsanKhan
Автор

It's very hard to follow. More mental energy is needed to grasp the concept.

bhaveshverma