you can use Eloquent or 'normal' SQL for your queries.
At the beginning it might be easier for more complex queries not to use Eloquent.
http://laravel.com/docs/5.0/queries#joins
SQL query on multiple tables
Hi,
I am building a website with huge database using laravel. I have a filter page on the website like student has to select a country, degree, tag to find a course.
I have 3 tables: University(holds country column) Course( holds degree column) Tag(CourseId and TagId column)
Also please tell me how use laravel model architecture to put where condition on all the three tables:
University extends Model{ public function course() { return $this->hasMany('App/Courses') } } Courses extends Model { public function university() { return $this->belongsTo('App/University') } public function tags() { return $this->hasMany('App/Tags') } }
How to put where condition like countrycode is 1 and degreecode is 1 and tagcode is 1
Please help i am new to laravel and hoping to get a best query here.
Please or to participate in this conversation.