更新遷移檔(migration)並新增自動產生的Model
This commit is contained in:
65
app/TheCase.php
Normal file
65
app/TheCase.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
* Date: Sat, 28 Jul 2018 18:02:51 +0000.
|
||||
*/
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
|
||||
/**
|
||||
* Class TheCase
|
||||
*
|
||||
* @property string $TCID
|
||||
* @property string $CBID
|
||||
* @property string $name
|
||||
* @property string $class
|
||||
* @property string $description
|
||||
* @property int $specialPrice
|
||||
* @property int $price
|
||||
* @property string $howToBuy
|
||||
* @property \Carbon\Carbon $releaseDate
|
||||
*
|
||||
* @property \App\CaseBuilder $case_builder
|
||||
* @property \Illuminate\Database\Eloquent\Collection $commissioneds
|
||||
*
|
||||
* @package App
|
||||
*/
|
||||
class TheCase extends Eloquent
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
protected $table = 'TheCase';
|
||||
public $incrementing = false;
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'specialPrice' => 'int',
|
||||
'price' => 'int'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'releaseDate'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'class',
|
||||
'description',
|
||||
'specialPrice',
|
||||
'price',
|
||||
'howToBuy',
|
||||
'releaseDate'
|
||||
];
|
||||
|
||||
public function case_builder()
|
||||
{
|
||||
return $this->belongsTo(\App\CaseBuilder::class, 'CBID');
|
||||
}
|
||||
|
||||
public function commissioneds()
|
||||
{
|
||||
return $this->hasMany(\App\Commissioned::class, 'TCID');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user