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 ...

Комментарии • 36

  • @codestepbystep
    @codestepbystep  2 года назад +6

    Please support me by subscribe, like and comment :) thank you

  • @Entertainment-sh4ew
    @Entertainment-sh4ew 3 года назад +17

    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');
    }

  • @abdul_qadir7780
    @abdul_qadir7780 2 года назад +1

    thank you bhai. you save my time..

  • @maulikmacwan6694
    @maulikmacwan6694 2 года назад

    thank you for simple and precise explanation

  • @nirajmeshram4
    @nirajmeshram4 3 года назад

    Thanks for such useful video

  • @mahaminam3806
    @mahaminam3806 2 года назад

    Amazing!!

  • @msmediascreenentertainment1951
    @msmediascreenentertainment1951 2 года назад

    and good teaching method

  • @MilanParmar.
    @MilanParmar. 6 месяцев назад +1

    example of : multiple employee to one company you have given has
    many to one relation not one to one relation

  • @shivombhargava4983
    @shivombhargava4983 2 года назад +4

    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..

  • @bisnu-kundu
    @bisnu-kundu 3 года назад

    Thank you ❤️

  • @laughitout9299
    @laughitout9299 2 года назад +1

    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");

  • @khansahb7441
    @khansahb7441 2 года назад +1

    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.

  • @faisalurrahman3952
    @faisalurrahman3952 2 года назад +1

    Yes! we can made both one to one and one to many method in a model

    • @whiteknox477
      @whiteknox477 2 года назад

      Exactly we create multiple methods in a class and call the required one

  • @Antarctica163
    @Antarctica163 21 день назад

    Amazing 😍

  • @msmediascreenentertainment1951
    @msmediascreenentertainment1951 2 года назад

    yes we can make more funtion

  • @technourcedrive7745
    @technourcedrive7745 3 года назад

    yes you can do

  • @shaktishekhawat951
    @shaktishekhawat951 2 года назад

    Yes sir

  • @ABHISHEKKUMAR-ne3rk
    @ABHISHEKKUMAR-ne3rk 3 года назад

    ,pls make video on multi tancy

  • @dksoftup
    @dksoftup 2 года назад

    Users table update like photo and text field.

  • @wrpprajay464
    @wrpprajay464 Год назад

    Did You Define Table name in Company Model.

  • @soneriparesh580
    @soneriparesh580 2 года назад +1

    Hi, brow please create video for many to many and many to one

  • @barjinderkumar8933
    @barjinderkumar8933 Год назад

    Relation bna ke hum data insert kar sakte hai ???

  • @saryofatah4896
    @saryofatah4896 2 года назад

    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 ..

  • @pallisai8609
    @pallisai8609 3 года назад

    Hello sir instead of using relations we can't use joins

    • @taymoorkhan6376
      @taymoorkhan6376 3 года назад

      Ye eleqouent models k relations hain agr join use krne hain phr i guess humain query builder use karna parega

    • @ImproveProgrammingLogic
      @ImproveProgrammingLogic 3 года назад +3

      @@taymoorkhan6376 Right Relationship makes ur life easy....But you are frsher then must work in Joins

  • @jjplays404
    @jjplays404 2 года назад

    many to many relation video sir?

  • @jayeshbaviskar9619
    @jayeshbaviskar9619 2 года назад

    bhai mera chal nahi raha column not found bata raha he

  • @muhammadans7071
    @muhammadans7071 10 месяцев назад

    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)

  • @kartikmondal8182
    @kartikmondal8182 2 года назад

    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