laravel5.2 开启软删除


namespace App\Http\Models;

use Illuminate\Database\Eloquent\Model;
//引入软删除
use Illuminate\Database\Eloquent\SoftDeletes;

class Menu extends Model
{
    protected $table = 'menu';
    protected $primaryKey = 'id';
    //开启如删除
    use SoftDeletes;
    //数据表中的删除字段
    protected $dates = ['deleted_at'];
}
Laravel5.4开启软删除 http://www.xiaoshu168.com/php/122.html

你可能感兴趣的:(laravel)