Laravel 8 tutorial in Hindi - One to One Relation
HTML-код
- Опубликовано: 24 сен 2020
- In this laravel 8 hindi video tutorial, we learn what is One to One relation and what is relations in laravel in a simple way. This video is made by anil Sidhu in the Hindi language.
steps of video
What are Relations in Laravel
One to One Relation
Make Models and Controller
Make Relation & Show Data
Laravel tutorial in Hindi
Insta: code.steps
Interview Question in Laravel
Laravel 9 tutorial in Hindi
• Laravel 9 tutorial in ...
Please support me by subscribe, like and comment :) thank you
yes sir, i made two method in model and no error, it means we can do in the model.
Example: public function getCompanyData()
{
return $this->hasOne('App\Models\Company','emp_id');
}
public function getCompanyData1()
{
return $this->hasMany('App\Models\Company','emp_id');
}
thank you bhai. you save my time..
thank you for simple and precise explanation
Thanks for such useful video
Amazing!!
and good teaching method
example of : multiple employee to one company you have given has
many to one relation not one to one relation
I have a doubt .... please clarify foreign key connection manually using eloquent ... because column name may sometime be different than the eloquent naming convention which may result in unwanted outcomes..
Thank you ❤️
by default this function only looks for the column name containing "_d", so if you have column names other than containing "_id",
you can do it like this assuming you are writing this in Member Model
$this->hasOne("App\Models\Company","CompanyColumnName","MemberColumnName");
if u use hasMany() and you have more than one id's matching ,
than u can use both , but if instead of both. hasMany() will return same result.
Yes! we can made both one to one and one to many method in a model
Exactly we create multiple methods in a class and call the required one
Amazing 😍
Thank you! Cheers!
yes we can make more funtion
yes you can do
Yes sir
,pls make video on multi tancy
Users table update like photo and text field.
Did You Define Table name in Company Model.
Hi, brow please create video for many to many and many to one
Relation bna ke hum data insert kar sakte hai ???
bro kindly create one for muli user login from one form . please mene bht dakha ha mgr is say related video nhy mil rhy achye ..
Hello sir instead of using relations we can't use joins
Ye eleqouent models k relations hain agr join use krne hain phr i guess humain query builder use karna parega
@@taymoorkhan6376 Right Relationship makes ur life easy....But you are frsher then must work in Joins
many to many relation video sir?
bhai mera chal nahi raha column not found bata raha he
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'companies.employees_id' in 'where clause' (SQL: select * from `companies` where `companies`.`employees_id` = 1 and `companies`.`employees_id` is not null limit 1)
i fash this type of error SQLSTATE[42S02]: Base table or view not found: 1146 Table 'curdlaravel8.companies' doesn't exist (SQL: select * from `companies` where `companies`.`student_id` = 1 and `companies`.`student_id` is not null limit 1)SIR HOW TO SOLVE THIS ERROR PLEASE HELP
create a companies table
Same brother! I already created companies table also this error
Help me please