Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel eloquent relationships

<?php

namespace AppModels;

use IlluminateDatabaseEloquentModel;

class Project extends Model
{
    /**
     * Get all of the deployments for the project.
     */
    public function deployments()
    {
        return $this->hasManyThrough(Deployment::class, Environment::class);
    }
}
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #eloquent #relationships
ADD COMMENT
Topic
Name
7+8 =