Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel belongs to

<?php

namespace AppModels;

use IlluminateDatabaseEloquentModel;

class Phone extends Model
{
    /**
     * Get the user that owns the phone.
     */
    public function user()
    {
        return $this->belongsTo('AppModelsUser');
    }
}
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #belongs
ADD COMMENT
Topic
Name
2+9 =