for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Tinyissue package.
*
* (c) Mohamed Alsharaf <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tinyissue\Model\Traits\Project\User;
use Illuminate\Database\Eloquent\Relations;
/**
* RelationTrait is trait class containing the relationship methods for the Project\User model.
* @author Mohamed Alsharaf <[email protected]>
* @method Relations\BelongsTo belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null)
trait RelationTrait
{
* Returns the instance of the user in the project.
* @return Relations\BelongsTo
public function user()
return $this->belongsTo('User', 'user_id')->orderBy('firstname', 'ASC');
}
* Returns the instance of the project.
public function project()
return $this->belongsTo('Tinyissue\Model\Project', 'project_id')->orderBy('name', 'ASC');