-
echo?("hello?world");
查看全部 -
模版輸出@{{$name}}:{{$name}}查看全部
-
->lists(’name’,‘key’) key為下標的name數組查看全部
-
orm create新增需要fillable有允許的字段查看全部
-
chunk每次查多條、chunk(1000,function($students){})查看全部
-
pluck、獲取某個字段的值數組查看全部
-
知識點總結
安裝Laravel
核心目錄文件
路由
MVC
數據庫操作
Blade模板引擎
查看全部 -
increment('field',number)? 自增
decrement('field',number)? 自減
不加where條件 表中field相應字段全部修改
查看全部 -
內容不能少于5個字!
查看全部 -
laravel路由
路由請求:get (基礎路由)可以通過瀏覽器訪問
? ? ? ? ? ? ? ? ?post(基礎路由)不能通過瀏覽器訪問
? ? ? ? ? ? ? ? ?match(多請求路由),可以通過瀏覽器訪問
? ? ? ? ? ? ? ? ?any(多請求路由)可以通過瀏覽器訪問
查看全部 -
是 laravel5.6嗎查看全部
-
創建表的時候可以設定從哪個數字開始自增
查看全部 -
Roure(‘member’)查看全部
-
一個控制器對應一個文件夾,例如MemberController對應member文件夾查看全部
-
DB::table('student')
->insert([
['id'=>'1001','name'='zhangsan'],
['id'=>'1002','name'=>'lisi']
]);
//獲取所有數據
$students = DB::table('student')
->get();
dd($students);
//first
DB::table('student')
->orderBy('id','asc')
->first();
//where
DB::table('student')
->where('id','>=','1002')
->get();
//多條件
DB::table('student')
->whereRaw('id>=? and age>?',[1001,12])
->get();
//pluck / lists
$names = DB::table('student')
->lists('name','id');
//select
$students = DB::table('student')
->select('id','name','age')
->get();
//chunk
echo '<pre>';
DB::table('student')->chunk(5,function($students){
dd($students);
if(condict){
return false;
}
});
查看全部
舉報