public function privil(Request $request)
{
$User = Auth::user();
$now = Carbon::now();
$quantity = 10;
$information = DB::table('role_user')->where('times', '>=', $now)->select('times', 'user_id')->get();
try {
DB::table('users')->where('id', $information->user_id)->update(['points' => 10]);
return back()->with('success', ['Баланс пополнен!']);
}
catch (\Exception $exception) {
return back()->withErrors("Произошла ошибка, обратитесь к администратору!");
}
}
<form action="/search" accept-charset="UTF-8" method="post">
{!! csrf_field() !!}
<input type="text" id="Name" name="Name" placeholder="Название предмета">
<input type="submit" value="Найти">
</form>
Route::get('search', 'Admin\AdminController@show1')->name('search');
Route::post('search', 'Admin\AdminController@search')->name('search1');
public function search(Request $request)
{
$name = $request->input('Name');
$items = DB::connection('555')->table('Shop_Goods')->get();
$item = DB::connection('555')->table('Shop_Goods')->where('name', 'LIKE', '%' . $name . '%')->get();
return view('adminka.test')->with($name, $item);
}