Created
April 2, 2017 16:36
-
-
Save w00p/c6e599a46fa42bdfdfc9a4d147a58ed0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App; | |
| use Illuminate\Database\Eloquent\Model; | |
| class Activity extends Model | |
| { | |
| protected $fillable = [ | |
| 'subject_id', | |
| 'subject_type', | |
| 'user_id', | |
| 'name', | |
| ]; | |
| public function user() | |
| { | |
| return $this->belongsTo(User::class); | |
| } | |
| public function subject() | |
| { | |
| return $this->morphTo()->withTrashed(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment