$mostPopular = factory(Article::class, 1)->create(['reads' => 20]);
laravel5.5 返回的是 all collection格式
断言时
$this->assertEquals($mostPopular->first()->id, $articles->first()->id);
/**
* ServicePhoneController constructor.
*/
嗯 最好改成 .test .work 之类的,基本不会出问题
'''
{!! $user_list->links() !!}
'''
试试
'num' => 'required|integer|between:1,10',
试试呢
users 表 存在 content和 address 字段 ,但是如果把address改成address1 ,这两个save操作都不会执行
'''
\DB::beginTransaction();
try{
$user = \App\User::find(1);
$user->content = '内容';
$user->save();
$user->address1 = '东吴北路118号';
$user->save();
\DB::commit ();
}catch (\Exception $e) {
\DB::rollBack ();
}
'''
我这边可以的啊
try{
...
DB::commit ();
}catch (\Exception $e) {
...
DB::rollBack ();
}
没问题吧
optional$user->profile)->address
老大 这是写错了吗
嗯 昨天去试 entrust 也不能用了