Я пробовал request()->fullUrlWithQuery(), но тогда получается, что в методе я должен указать параметр и значение, но если у меня, например, 10 параметров, получается, что мне каждый надо указывать.
If you would like to append query string data to the current URL, you may call the fullUrlWithQuery method. This method merges the given array of query string variables with the current query string:
<a href="{{ request()->fullUrlWithQuery(['status' => 1]) }}">Status</a>
<a href="{{ request()->fullUrlWithQuery(['color' => 1]) }}">Color</a>
class CityFactory extends Factory
{
protected $model = City::class;
public function definition()
{
$tz = array_keys(Timezone::getData());
return [
'name' => $this->faker->city,
'timezone' => $this->faker->randomElement($tz),
'enabled' => true,
];
}
}
use Illuminate\Database\Eloquent\Factories\Sequence;
class CitySeeder extends Seeder
{
public function run()
{
$predefinedCities = array_reverse($this->getPredefinedCities());
City::factory(CITY_COUNT)
->state(new Sequence(function () use (&$predefinedCities) {
return array_pop($predefinedCities) ?? [];
}))
->create();
}
private function getPredefinedCities()
{
return [
[
'name' => 'Moscow',
'timezone' => '+0300',
'enabled' => true,
],
[
'name' => 'Saint-Petersburg',
'timezone' => '+0300',
'enabled' => true,
],
[
'name' => 'Sochi',
'timezone' => '+0300',
'enabled' => true,
],
];
}
}
app/helpers.php
(название и расположение не имеет значения)"autoload": {
"psr-4": {
...
},
"files": [
"app/helpers.php"
]
},
composer du
public function show(Category $category)
{
return response()->json($category->toArray());
}
Category
, таблица - categories
Route::post('categories/{category}')->name('category.update');
public function edit(Category $category)
{
return view('admin.category.edit', ['category' => $category]);
}
<form action="{{ route('category.update', $category) }}"
method="POST"
>
Также не удалось в коде фреймворка найти упоминание переменной окружения DB_CONNECTION.
php artisan make:command RouteListCommand
- $rootControllerNamespace = $this->laravel[UrlGenerator::class]->getRootControllerNamespace()
- ?? ($this->laravel->getNamespace().'Http\\Controllers');
+ $rootControllerNamespace = ($this->laravel->getNamespace().'Http\\Controllers');
$casts = [
'balance' => 'array',
];
$user->balance['BTS->Bitcoin_wallet'] = '';
$casts = [
'balance' => AsArrayObject::class,
];
$user->balance['BTS']['Bitcoin_wallet'] = '';