Laravel 8 tutorial in Hindi - One to One Relation

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 34

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

  • @shivombhargava4983
    @shivombhargava4983 3 роки тому +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..

  • @abdul_qadir7780
    @abdul_qadir7780 2 роки тому +1

    thank you bhai. you save my time..

  • @MilanParmar.
    @MilanParmar. 10 місяців тому +1

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

  • @maulikmacwan6694
    @maulikmacwan6694 3 роки тому

    thank you for simple and precise explanation

  • @faisalurrahman3952
    @faisalurrahman3952 3 роки тому +1

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

    • @whiteknox477
      @whiteknox477 3 роки тому

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

  • @msmediascreenentertainment1951
    @msmediascreenentertainment1951 3 роки тому

    and good teaching method

  • @laughitout9299
    @laughitout9299 3 роки тому +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.

  • @nirajmeshram4
    @nirajmeshram4 3 роки тому

    Thanks for such useful video

  • @barjinderkumar8933
    @barjinderkumar8933 Рік тому

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

  • @technourcedrive7745
    @technourcedrive7745 3 роки тому

    yes you can do

  • @wrpprajay464
    @wrpprajay464 2 роки тому

    Did You Define Table name in Company Model.

  • @shaktishekhawat951
    @shaktishekhawat951 2 роки тому

    Yes sir

  • @mahaminam3806
    @mahaminam3806 3 роки тому

    Amazing!!

  • @msmediascreenentertainment1951
    @msmediascreenentertainment1951 3 роки тому

    yes we can make more funtion

  • @ABHISHEKKUMAR-ne3rk
    @ABHISHEKKUMAR-ne3rk 4 роки тому

    ,pls make video on multi tancy

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

  • @bisnu-kundu
    @bisnu-kundu 3 роки тому

    Thank you ❤️

  • @soneriparesh580
    @soneriparesh580 3 роки тому +1

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

  • @jjplays404
    @jjplays404 2 роки тому

    many to many relation video sir?

  • @dksoftup
    @dksoftup 2 роки тому

    Users table update like photo and text field.

  • @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

  • @muhammadans7071
    @muhammadans7071 Рік тому

    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)

  • @jayeshbaviskar9619
    @jayeshbaviskar9619 2 роки тому

    bhai mera chal nahi raha column not found bata raha he

  • @kartikmondal8182
    @kartikmondal8182 3 роки тому

    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