return array (
'Accept Cookies' => 'Accept Cookies',
'Cookie info' => 'Please be informed that we use cookies to enhance your user experience.
For a complete overview of all cookies used, please see our
<a href="'.route('frontend.pages.cookies').'" class="hero_side__link">Cookies Policy</a>
and <a href="'.route('frontend.pages.privacy').'" class="hero_side__link">Privacy Policy</a>.',
);
return array (
'Cookie info' => 'Please be informed that we use cookies to enhance your user experience.
For a complete overview of all cookies used, please see our
<a href=":policy_url" class="hero_side__link">Cookies Policy</a>
and <a href=":privacy_url" class="hero_side__link">Privacy Policy</a>.',
);
{{! __('Cookie info', [
'policy_url' => route('frontend.pages.cookies'),
'privacy_url' => route('frontend.pages.privacy'),
]) !}}
$users = User::factory()->count(3)->make();
Setting
settings
setting_user
user_id | setting_id
public function settings() {
return $this->belongsToMany(Setting::class);
}
$user->settings
$user->settings->create([...])
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up()
{
Schema::create('{{ table }}', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('{{ table }}');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up()
{
}
public function down()
{
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up()
{
Schema::table('{{ table }}', function (Blueprint $table) {
});
}
public function down()
{
Schema::table('{{ table }}', function (Blueprint $table) {
});
}
};
Category::all()
, то вам все и выплевываются.'mainMenu' => CategoryResource::collection(Category::where('enabled', true)->get()),
class User {
public function roles(): BelongsToMany {
return $this->belongsToMany(Role::class);
}
}
class Role {
public function users(): BelongsToMany {
return $this->belongsToMany(User::class);
}
}
$user = User::create([...]);
$user->roles()->attach(Role::whereSlug('user')->firstOrFail());
$user->profiles()->create([
]);
public function buyProduct($id){
$product = Product::where('id',$id)->get();
$userId = Auth::user()->id;
$sellerUserId = $product->first()->seller_user_id;
$sellerUserIdBalance = User::where('id',$sellerUserId)->get()->first()->balance;
User::where('id', $sellerUserId)->update(array('balance' => $sellerUserIdBalance+$productPrice));
old()
old('hobby')
у вас будет массив@foreach(old('hobby') as $value)
<input name="hobby[]" value="{{ $value }}"
@endforech
@if ($errors->any())
@foreach ($errors->all() as $error)
<p>{{ $error }}</p>
@endforeach
@endif
composer create-project laravel/laravel example-app
И все бы хорошо, но я не нашел об этом информации в документации.