-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectUpdate.php
More file actions
55 lines (47 loc) · 1.96 KB
/
ProjectUpdate.php
File metadata and controls
55 lines (47 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php namespace PatchNotes\Models;
use Illuminate\Database\Eloquent\Model;
/**
* An Eloquent Model: 'ProjectUpdate'
*
* @property integer $id
* @property integer $project_id
* @property string $title
* @property string $slug
* @property string $body
* @property integer $subscription_level
* @property integer $user_id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property \Carbon\Carbon $deleted_at
* @property-read \Project $project
* @property-read \User $author
* @property integer $level
* @property integer $project_update_level_id
* @method static \Illuminate\Database\Query\Builder|\ProjectUpdate whereId($value)
* @method static \Illuminate\Database\Query\Builder|\ProjectUpdate whereProjectId($value)
* @method static \Illuminate\Database\Query\Builder|\ProjectUpdate whereTitle($value)
* @method static \Illuminate\Database\Query\Builder|\ProjectUpdate whereSlug($value)
* @method static \Illuminate\Database\Query\Builder|\ProjectUpdate whereBody($value)
* @method static \Illuminate\Database\Query\Builder|\ProjectUpdate whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\ProjectUpdate whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\ProjectUpdate whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\ProjectUpdate whereDeletedAt($value)
* @method static \Illuminate\Database\Query\Builder|\ProjectUpdate whereProjectUpdateLevelId($value)
* @property-read mixed $href
*/
class ProjectUpdate extends Model
{
protected $table = "project_updates";
public function project()
{
return $this->belongsTo('PatchNotes\Models\Project');
}
public function author()
{
return $this->belongsTo('PatchNotes\Models\User', 'user_id');
}
public function getHrefAttribute()
{
return action('Projects\\UpdateController@show', array($this->project->owner->slug, $this->project->slug, $this->slug));
}
}