forked from eatvio/eatvio-infra
40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* App\Models\PlanLike
|
|
*
|
|
* @property int $id
|
|
* @property int $plan_id
|
|
* @property int $user_id
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PlanLike forPlan(\App\Models\Plan $plan)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PlanLike newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PlanLike newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PlanLike query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PlanLike whereCreatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PlanLike whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PlanLike wherePlanId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PlanLike whereUpdatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PlanLike whereUserId($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class PlanLike extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
];
|
|
|
|
public function scopeForPlan($query, Plan $plan)
|
|
{
|
|
return $query->where('plan_id', $plan->id);
|
|
}
|
|
}
|