Laravel Community Tools by Tighten

Category "Eloquent" tricks

140 tricks
Migration file sample for Pivot table
Mahmoudz 9 years ago 30378
I want to use function attempt for login authenticate but i don't want send variable password * If i run code this it will show error "Undefined index: password" and this below vendor\laravel\framework\src\Illuminate\Auth\EloquentUserProvider.php public function validateCredentials(UserInterface $user, array $credentials) { $plain = $credentials['password']; return $this->hasher->check($plain, $user->getAuthPassword()); How can i do that . pls thank you
userhuman 10 years ago 9179
This is a short video series in two parts about how you can setup different user roles for users in your application using Laravel. It conists of users, roles and user_role tables for this type of relationships between users and their roles. It should all be clearly explained inside of the tutorials. There are ways of improving this functionality and it is really easy to add more roles if needed, build on top of it etc. Hope it will be useful to you and if you have any questions, ask away :) https://www.youtube.com/watch?v=KMR2H6-K36E
Novica89 10 years ago 8150
When you have a model with unique value column and tries seeder your table using a big amout, sometimes the QueryException is thrown, because Faker doesn't know what values was previously generated and the number of combinations is limited.
lcdss 10 years ago 16113
Get a List of Recent queries that have been run on your app
unicodevel... 10 years ago 7161
Hi, I have 3 tables USER, ALBUMS, PHOTOS USER has one to many relation with ALBUMS, ALBUMS has one to many relation with photos. My relation mapping as follows
ajeeeunni 10 years ago 13483
You can see SQL Query of your DB table on Laravel App, by Event listener.
ahaneef29 10 years ago 8263
Let's say that your validation is conditional on multiple rules.... This is a bit tricky because it's not obvious how to get the other rules passed to the validator. Here's how you'd do it
sgelbart 10 years ago 9053
4.0
When registering a model observer using `Model::observer(Observer::class)`, you can return false and laravel will cancel the method.
stevebauma... 10 years ago 21161