| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace App\Module\Game\Models;
- use App\Module\Game\Database\Factories\TestFactory;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use UCore\ModelCore;
- use Illuminate\Database\Eloquent\SoftDeletes;
- use App\Module\Game\Events\TestEvent;
- /**
- * App\Module\Game\Models\Test
- *
- * field start
- * @property int $id
- * @property string $name 名称
- * @property string $code 编码
- * @property string $description 描述
- * @property object|array $data 数据
- * @property int $status 状态:0禁用 1启用
- * @property \Carbon\Carbon $created_at
- * @property \Carbon\Carbon $updated_at
- * @property \Carbon\Carbon $deleted_at
- * field end
- */
- class Test extends ModelCore
- {
- use HasFactory, SoftDeletes;
- /**
- * 与模型关联的表名
- *
- * @var string
- */
- protected $table = 'test';
- // attrlist start
- protected $fillable = [
- 'id',
- 'name',
- 'code',
- 'description',
- 'data',
- 'status',
- ];
- // attrlist end
- /**
- * 应该被调整为日期的属性
- *
- * @var array
- */
- protected $dates = [
- 'created_at',
- 'updated_at',
- 'deleted_at'
- ];
- /**
- * 属性类型转换
- *
- * @var array
- */
- protected $casts = [
- 'data' => 'array',
- 'status' => 'integer'
- ];
- /**
- * 创建一个新的工厂实例
- *
- * @return \Illuminate\Database\Eloquent\Factories\Factory
- */
- protected static function newFactory()
- {
- return TestFactory::new();
- }
- }
|