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