1
0
Files
GongShangLian/app/Models/Followable.php
2020-08-06 15:36:28 +08:00

26 lines
389 B
PHP

<?php
namespace App\Models;
use App\User;
use Auth;
class Followable extends Model
{
public function user()
{
return $this->belongsTo(user::class)->withDefault();
}
public function followable()
{
return $this->morphTo();
}
public function scopeMine($query)
{
return $query->where('user_id', \Auth::guard('api')->id());
}
}