Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel has one

enough database theory
look at the most often example – when User has a Profile
=> they are related with one-to-one relationship
   one user has only one profile
  
class User extends Model
{
    function profile() {
        return $this->hasOne('AppUserProfile');
    }
}
Source by blog.quickadminpanel.com #
 
PREVIOUS NEXT
Tagged: #laravel
ADD COMMENT
Topic
Name
7+7 =