$("button").click(function (e) {
text = $(e.target).closest(".panel").find(".panel-heading").text();
alert(text);
});
#!/bin/bash
wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
gzip -d GeoLite2-City.mmdb.gz && gzip -d GeoLite2-Country.mmdb.gz
mv GeoLite2-*.mmdb helpers/GeoIP2/db/
$result = Goods::query()
->whereHas('category', function ($query) use ($category) {
/** @var \Illuminate\Database\Query\Builder $query */
$query->where('cat_name', $category);
})
->whereHas('region', function ($query) use ($region) {
/** @var \Illuminate\Database\Query\Builder $query */
$query->where('region_name', $region);
})
->where('id', $id)
->with('category', 'region')
->first(); // можно ->firstOrFail() = само выкинет ошибку
if ($result === null) {
// 404
}
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(...)
}
$user = \Auth::attempt(['email' => $request['email'], 'password' => $request['password']], true, true);
if(!$user) {
$validator->errors()->add('email', 'Incorrect username or password.');
return \Redirect::back()
->withErrors($validator)
->withInput();
}
@if ($errors->has())
@foreach ($errors->all() as $error)
{{ $error }}
@endforeach
@endif
return redirect()->back()->with('error', 'Неверная пара логин пароль');
if(Session::has('error'))
{{ Session::get('error') }}
@endif
.head_block {
width: 100%;
height: 100%;
position: relative;
overflow:hidden;
}
video{
min-width:100%;
min-height:100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}