This commit is contained in:
ct
2025-07-02 01:08:11 +08:00
parent 209c022f1d
commit 68a47ec916
19 changed files with 503 additions and 75 deletions

View File

@@ -11,21 +11,19 @@
/**
* Class Plan
*
*
* @property int $id
* @property string $name
* @property string $tier
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
* @package App\Models
*/
class Plan extends Model
{
protected $table = 'plans';
protected $table = 'plans';
protected $fillable = [
'name',
'tier'
];
protected $fillable = [
'name',
'tier',
];
}

View File

@@ -7,13 +7,14 @@
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Cashier\Billable;
use Laravel\Sanctum\HasApiTokens;
use Str;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasApiTokens, HasFactory, Notifiable, SoftDeletes;
use HasApiTokens, HasFactory, Notifiable, SoftDeletes, Billable;
/**
* The attributes that are mass assignable.

View File

@@ -11,7 +11,7 @@
/**
* Class UserPlan
*
*
* @property int $id
* @property int $user_id
* @property int $plan_id
@@ -20,26 +20,24 @@
* @property Carbon|null $canceled_at
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
* @package App\Models
*/
class UserPlan extends Model
{
protected $table = 'user_plans';
protected $table = 'user_plans';
protected $casts = [
'user_id' => 'int',
'plan_id' => 'int',
'current_period_end' => 'datetime',
'cancel_at' => 'datetime',
'canceled_at' => 'datetime'
];
protected $casts = [
'user_id' => 'int',
'plan_id' => 'int',
'current_period_end' => 'datetime',
'cancel_at' => 'datetime',
'canceled_at' => 'datetime',
];
protected $fillable = [
'user_id',
'plan_id',
'current_period_end',
'cancel_at',
'canceled_at'
];
protected $fillable = [
'user_id',
'plan_id',
'current_period_end',
'cancel_at',
'canceled_at',
];
}

36
app/Models/UserUsage.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class UserUsage
*
* @property int $id
* @property int $user_id
* @property int $non_watermark_videos_left
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
* @package App\Models
*/
class UserUsage extends Model
{
protected $table = 'user_usages';
protected $casts = [
'user_id' => 'int',
'non_watermark_videos_left' => 'int'
];
protected $fillable = [
'user_id',
'non_watermark_videos_left'
];
}