Можно конечно, но вот хочу решить по другому.
The point to take away is that there is no defined standard for what happens here and it's entirely at the whim of the browser - so as far as possible in whatever you're doing, try to avoid relying on any particular behaviour.
class="col-12 col-sm-6 col-md-3"
cities
и airports
(обратите внимание – названия во мн. числе)id | name | другие поля, если нужно
id | city_id | name | другие поля, если нужно
City
и Airport
(обратите внимание – названия в ед. числе)City
создать отношение один-ко-многим (в городе может быть несколько аэропортов)public function airports(): \Illuminate\Database\Eloquent\Relations\HasMany {}
return $this->hasMany(\App\Models\Airport::class);
}
Airport
создать обратное отношениеpublic function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo {}
return $this->belongsTo(\App\Models\City::class);
}
$from = $request->input['otkuda'];
$city = \App\Models\City::whereName($from) // По названию города
->firstOrFail();
// или
// $fromId = $request->input['otkuda'];
// $city = \App\Models\City::findOrFail($fromId); // По ID города
dump($city->toArray()); // Получили город
dump($city->airports->toArray()); // Получили список аэропортов города
$airportId = $request->input['airportId'];
$airport = \App\Models\Airport::findOrFail($airportId);
dump($airport->toArray()); // Получили аэропорт по ID
dump($airport->city->toArray()); // Получили город, в котором этот аэропорт находится.
``
– шаблонная строка`${variable}`
- переменная в такой строке, или любое выражение[]
- массив, доступ к элементу массива по индексу или ключуid.length-1
- обычное выражение, длина массива минус одинid[id.length-1]
- доступ к последнему элементу массиваlet lastIndex = id.length-1;
let lastElement = id[lastIndex];
`./articles/${lastElement}`
<table border="1" width="700" height="150">
<col width="20%">
<col width="20%">
<col width="10%">
<col width="10%">
<col width="20%">
<col width="20%">
<tr>
<td colspan="6">Alan1</td>
</tr>
<tr>
<td colspan="2">Alan2</td>
<td colspan="2">Alan3</td>
<td colspan="2">Alan4</td>
</tr>
<tr>
<td rowspan="3">Alan5</td>
<td colspan="2">Alan6</td>
<td colspan="2">Alan7</td>
<td rowspan="3">Alan8</td>
</tr>
<tr>
<td>Alan9</td>
<td colspan="2" rowspan="2">Alan10</td>
<td>Alan11</td>
</tr>
<tr>
<td>Alan12</td>
<td>Alan13</td>
</tr>
</table>
{{--@if (isset($citi))--}}
<table class="table-hover">
<thead>
<tr>
</tr>
</thead>
<tbody>
@if($posts->isNotEmpty())
@foreach ($posts as $post)
<div class="post-List">
<p>{{ Spost-nane }}</p>
@endForeach
@else
<div>
<h2>No posts Found</h2>
</div>
@endif
</tbody>
</table>
{{--@endif--}}
:root {
--aside-width: 200px; /* По умолчанию */
}
.aside {
width: var(--aside-width);
}
.main {
margin-right: var(--aside-width);
}
document.documentElement.style.setProperty('--aside-width', '200px'); // show
document.documentElement.style.setProperty('--aside-width', '0'); // hide
{!! old('name', $product->description) !!}
{{ old('name') ?? new HtmlString($product->description) }}
"scripts": {
"post-autoload-dump": []
}
"post-root-package-install": []
"scripts": {
"post-autoload-dump": [
"@php -r \"copy('vendor/twbs/bootstrap/dist/boostrap.min.css', 'public/css/boostrap.min.css');\""
]
}