更新遷移檔(migration)並新增自動產生的Model
This commit is contained in:
55
app/Belong.php
Normal file
55
app/Belong.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
* Date: Sat, 28 Jul 2018 18:02:51 +0000.
|
||||
*/
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
|
||||
/**
|
||||
* Class Belong
|
||||
*
|
||||
* @property string $RID
|
||||
* @property int $CID
|
||||
* @property \Carbon\Carbon $startExclussiveDate
|
||||
* @property \Carbon\Carbon $endExclussiveDate
|
||||
*
|
||||
* @property \App\Receiver $receiver
|
||||
* @property \App\TheClass $the_class
|
||||
*
|
||||
* @package App
|
||||
*/
|
||||
class Belong extends Eloquent
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
protected $table = 'Belong';
|
||||
public $incrementing = false;
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'CID' => 'int'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'startExclussiveDate',
|
||||
'endExclussiveDate'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'startExclussiveDate',
|
||||
'endExclussiveDate'
|
||||
];
|
||||
|
||||
public function receiver()
|
||||
{
|
||||
return $this->belongsTo(\App\Receiver::class, 'RID');
|
||||
}
|
||||
|
||||
public function the_class()
|
||||
{
|
||||
return $this->belongsTo(\App\TheClass::class, 'CID');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user