Laravel Community Tools by Tighten

Recent tricks

459 tricks
Send a reinitilisation code (6 digits) by email instead of a pratice link for mobile customers. In this case we are using fortify but working well with the laravel authentication system in general.
gabeta 4 years ago 15436
This query searches the data from the Table and also with its relation table columns dynamically.
Muzamil-kh... 5 years ago 10447
Get products count which are under sub categories of a parent category
Faridbabay... 5 years ago 11807
set custom table name for eloquent model
uniqueginu... 5 years ago 8213
Using laravel eloquent, you have an amazing feature called `Accessors`, which allows you to define a non-existing column, here's an example to get user full_name that does not exist in the users table
thefeqy 5 years ago 16114
# Report(): The report() method allows us to log the raised exceptions or parse them to various error logging engines like the sentry. All this method does by default is passing the thrown exception to the base class where it is logged, but we are free to customize.
harshaldos... 5 years ago 10235
If you only need the functionality of a custom rule once throughout your application, you may use a Closure instead of a rule object. The Closure receives the attribute's name, the attribute's value, and a $fail callback that should be called if validation fails. Below is the code example:
asifzcpe 5 years ago 21575
If you have DB column which you want to be set only once and never updated again, you can set that restriction on Eloquent Model, with a mutator
fatihtopra... 5 years ago 17875
What if you’re working with non-Laravel database and your timestamp columns are named differently? Maybe, you have create_time and update_time. Luckily, you can specify them in the model, too
fatihtopra... 5 years ago 15290