public function search()
{
$items = explode(" ",Request::get('words'));
$Articles = new Articles();
foreach ($items as $item){
$Articles->where('title', 'LIKE', '%' . $words . '%')
// $Articles->orWhere('title', 'LIKE', '%' . $words . '%') тут как хотите
}
$results = $Articles -> get();
return $results;
}
<input type="submit" name="login">
<input type="submit" name="register">
function handler() {
if(isset($POST['login'])){
$this->login();
}elseif(isset($POST['register'])){
$this->register();
}
}
private function login(){
//Ваша логика авторизации
}
private function register(){
//Ваша логика регистрации
}
// Provider
$toute->bind('my_model', Blog::class);
// Route
Route::get('entity/{my_model}', 'EntityController@edit');
// Controller
class EntityController {
public function edit(Blog $model)
{
//code
}
}
return redirect()->route('article.edit')->withInputs()->withErrors();
public function show($region, $category, $id){
$Region = Region::where('region_code', '=', $region)->first();
$Category = Category::where('cat_name', '=', $category)->first();
$Region->products()->where('good_region', $Region->id)->where('good_cat', '=', $Category->id)->where('id', '=', $id)->first();
return view(...)
}
status_history
- increment id
- integer status_id
- integer apply_id
- integer user_id
- string comment
- timestamps
applies
- increment id
- .....
- status_id
apply_statuses
- increment id
- string title