当前位置:网站首页>Laravel8 when search
Laravel8 when search
2022-06-12 05:33:00 【Python's path to becoming a God】
// Query list
Route::get('newsList', [\App\Http\Controllers\NewsController::class, 'newsList'])->middleware(['ckadmin']); // Query list
public function usersList(Request $request){
$keywords=$request->input('keywords');
$data=Users::usersList($keywords);
return view('index/usersList',compact('data'));
} public static function usersList($keywords){
return self::when($keywords,function ($query) use ($keywords){
$query->where('username','like',"%$keywords%");
})->get();
}You cannot delete the user
// Delete data
Route::get('newsDel/{id}', [\App\Http\Controllers\NewsController::class, 'newsDel'])->middleware(['ckadmin']); // Delete data
public function usersDel($id){
$res=Users::usersDel($id);
if($res){
return redirect('usersList');
}
}// Delete data
public static function usersDel($id){
return self::destroy($id);
} @if(auth()->user()->id != $val->id)
<td><a href="{
{url('usersDel',['id'=>$val->id])}}"><button> Delete </button></a></td>
@endif
</tr>
@endforeachmiddleware
// Check whether the user is logged in
if(!auth()->check()){
return redirect('loginShow')->withErrors(' Please log in first ');
}
return $next($request);边栏推荐
- Pupanvr create project and management script (2)
- Reason: Canonical names should be kebab-case (‘-‘ separated), lowercase alpha-numeric characters and
- Simple introduction to key Wizard
- 51. reverse order pairs in the array
- The combined application of TOPSIS and fuzzy borde (taking the second Dawan District cup and the national championship as examples, it may cause misunderstanding, and the Dawan District cup will be up
- [machine learning] first day of introduction
- merge sort
- Legal liabilities to be borne by the person in charge of the branch
- XML参数架构,同一MTK SW版本兼容两套不同的音频参数
- Matlab: image rotation and interpolation and comparison of MSE before and after
猜你喜欢

yolov5

The combined application of TOPSIS and fuzzy borde (taking the second Dawan District cup and the national championship as examples, it may cause misunderstanding, and the Dawan District cup will be up

Codis 3. X expansion and contraction

Simple introduction to key Wizard

Matlab: halftone and dither conversion

Deep understanding of asynchronous programming

Towards End-to-End Lane Detection: an Instance SegmentationApproach

WiFi protocol and ieee905 protocol learning details

Multi thread learning 4. Sleep, wait, yield, join (), ThreadGroup control the running of threads

How long is the company's registered capital subscribed
随机推荐
31. stack push in and pop-up sequence
CODIS long link test
ESP8266 Arduino OLED
Field xxxxDAO in com. nero. hua. service. impl. LoginServiceImpl required a bean of type
Project requirements specification
What is thinking
GRE protocol details
MySQL Linux Installation mysql-5.7.24
个人申请OV类型SSL证书
Save the object in redis, save the bean in redis hash, and attach the bean map interoperation tool class
Wireshark filter rule
How Wireshark decrypts WiFi data packets
Details of FPGA syntax
论文阅读_图神经网络GIN
Automated test - dark horse headline test project
yolov5
Multi thread learning III. classification of threads
Lldp protocol
43. Number of occurrences of 1 in 1 ~ n integers
Is the individual industrial and commercial door a legal person enterprise