SamplePost.php - opensource-workshop/connect-cms GitHub Wiki
SamplePost.php(記事 モデル)
<?php
namespace App\ModelsOption\User\Samples;
use Illuminate\Database\Eloquent\Model;
use App\UserableNohistory;
/**
* 記事 モデル
*
* @author 永原 篤 <[email protected]>
* @copyright OpenSource-WorkShop Co.,Ltd. All Rights Reserved
* @category サンプル・プラグイン
* @package Controller
*/
class SamplePost extends Model
{
// 保存時のユーザー関連データの保持
use UserableNohistory;
// 更新する項目の定義
protected $fillable = ['sample_id', 'title', 'content'];
}
- UserableNohistory をuse することで、Connect-CMS のテーブルサフィックスが自動で登録されます。
- $fillable はLaravel の複数代入です。