标签:model 返回值 name operator lan count keyword tor prope
$users = DB::table(‘users‘)->get();
返回值:数组结果,其中每一个结果都是 StdClass$user = DB::table(‘users‘)->first();
$user = User::first();
返回值:Eloquent 对象 `$user = User::find();
返回值:Eloquent 对象 `$users = User::get();
返回值:Eloquent 集合$users = User::all();
返回值:Eloquent 集合$user = User::create($data);
返回值:Eloquent 对象$user = new User();
$user->name = "admin"
$user->save();
返回值:Eloquent 对象
$result = User::insert($data);
返回值:bool$result = $user->delete();
返回值:bool$count = User::destroy([1, 2]);
返回值:删除记录数$count = User::where(‘id‘, ‘>‘, 1)->delete();
返回值:删除记录数$count = User::where(‘id‘, ‘>‘, 10)->update([‘status‘ => 1]);
$count = User::where(‘id‘, ‘>‘, 10)->increment(‘age‘, 1);
标签:model 返回值 name operator lan count keyword tor prope
原文地址:https://www.cnblogs.com/houss/p/12001137.html