Load table user and table bookings joined on user_id where ' bookings.starts_at '>' 2015-07-04 '.
User::with(['bookings'=>function($query){
$query->where('starts_at' , '>', date('Y-m-d'));
}])->get();
Put your models into Models folder.
Model for user:
class User extends Eloquent {
protected $table = 'users';
...
13 July, 2020
20 May, 2020
135+ Laravel interview questions and answers in 2020
Programing Coderfunda
May 20, 2020
Laravel - Interview questions, Laravel - questions
No comments
Laravel interview questions1) What is Laravel?2) Explain Events in laravel ?3) Explain validations in laravel?4) How to install laravel via composer ?5) List some features of laravel 6 ?6) What is PHP artisan. List out some artisan commands ?7) List some default packages provided by Laravel Framework?8) What are named routes in Laravel?9) What is database...
135+ Laravel interview questions and answers in 2020
Programing Coderfunda
May 20, 2020
Laravel - Interview questions, Laravel - questions
No comments
Laravel interview questions
1) What is Laravel?
2) Explain Events in laravel ?
3) Explain validations in laravel?
4) How to install laravel via composer ?
5) List some features of laravel 6 ?
6) What is PHP artisan. List out some artisan commands ?
7) List some default packages provided by Laravel Framework?
8) What are named routes in Laravel?
9)...