Becker Maxime
Becker Maxime
FFilament
Created by Benjámin on 11/14/2023 in #❓┊help
Saving relationships when creating record with Repeater
Why not use the create() function to check your data.
6 replies
FFilament
Created by Becker Maxime on 11/15/2023 in #❓┊help
filepload display problem
The solution is to type the following command:
php artisan storage:link
php artisan storage:link
10 replies
FFilament
Created by Becker Maxime on 11/15/2023 in #❓┊help
filepload display problem
10 replies
FFilament
Created by Becker Maxime on 11/15/2023 in #❓┊help
filepload display problem
I still don't have a preview
10 replies
FFilament
Created by Becker Maxime on 11/15/2023 in #❓┊help
filepload display problem
FileUpload::make('logo')
->image()
->imageEditor()
->previewable(true)
->columnSpan(2),
FileUpload::make('logo')
->image()
->imageEditor()
->previewable(true)
->columnSpan(2),
10 replies
FFilament
Created by Becker Maxime on 11/15/2023 in #❓┊help
filepload display problem
No description
10 replies
FFilament
Created by Becker Maxime on 11/14/2023 in #❓┊help
reactive action
QuoteResource :
Forms\Components\Select::make('status')
->disabled(function ($record) {
return $record?->invoice;
})
->options([
Quote::UNPAID => 'Non payé',
Quote::PENDING => 'En attente',
Quote::PAID => 'Payé',
])
Forms\Components\Select::make('status')
->disabled(function ($record) {
return $record?->invoice;
})
->options([
Quote::UNPAID => 'Non payé',
Quote::PENDING => 'En attente',
Quote::PAID => 'Payé',
])
4 replies
FFilament
Created by Becker Maxime on 11/14/2023 in #❓┊help
reactive action
Example : I'd like to update this hidden function without reloading my page. EditQuote :
Action::make('paid_deposit_amount')
->label(__('quote-resource.action.paid_deposit_amount'))
->requiresConfirmation()
->url(fn($record): string => route('generate.payement.quote', ['id' => $record->id]))
->openUrlInNewTab()
->hidden(function ($record) {
return !is_numeric($record->artist->vat_rate)
|| !is_numeric($record->deposit_amount)
|| !$record->artist->key_stripe
|| $record->status == Quote::PAID;
}),
Action::make('paid_deposit_amount')
->label(__('quote-resource.action.paid_deposit_amount'))
->requiresConfirmation()
->url(fn($record): string => route('generate.payement.quote', ['id' => $record->id]))
->openUrlInNewTab()
->hidden(function ($record) {
return !is_numeric($record->artist->vat_rate)
|| !is_numeric($record->deposit_amount)
|| !$record->artist->key_stripe
|| $record->status == Quote::PAID;
}),
4 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
@Hugh Messenger Thank you very much. it works, I didn't know laravel didn't handle composite keys, thank you very much. Bisous
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
Thank you very much for your time. I hope I won't have to call you back.
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
Ok thanks for your help, I'll try that on Monday. Thanks
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
Ok, but I use hasMany to make my repeater work, do I have to sing again for belongsToMany()?
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
I need to add $table->id() in my migration ?
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
my pivot model has two primary keys, artist_id and lead_id, I don't understand why I should add a primary key.
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
I have two tables leads and artists and a pivot table artist_lead
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
public function up(): void
{
Schema::create('artist_lead', function (Blueprint $table) {
$table->unsignedBigInteger('lead_id');
$table->foreign('lead_id')->references('id')->on('leads')->onDelete('cascade');
$table->unsignedBigInteger('artist_id');
$table->foreign('artist_id')->references('id')->on('artists')->onDelete('cascade');
$table->boolean('accept')->default(0);
$table->boolean('refuse')->default(0);
$table->primary(['lead_id', 'artist_id']);
$table->timestamps();
});
}
public function up(): void
{
Schema::create('artist_lead', function (Blueprint $table) {
$table->unsignedBigInteger('lead_id');
$table->foreign('lead_id')->references('id')->on('leads')->onDelete('cascade');
$table->unsignedBigInteger('artist_id');
$table->foreign('artist_id')->references('id')->on('artists')->onDelete('cascade');
$table->boolean('accept')->default(0);
$table->boolean('refuse')->default(0);
$table->primary(['lead_id', 'artist_id']);
$table->timestamps();
});
}
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
so that's not the case, I don't understand why it makes a where twice the identifier of my lead.
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\Pivot;

class ArtistLead extends Pivot
{
use HasFactory;

protected $fillable = [
'lead_id',
'artist_id',
'accept',
'refuse',
];

public function artist(): BelongsTo
{
return $this->belongsTo(Artist::class);
}

public function lead(): BelongsTo
{
return $this->belongsTo(Lead::class);
}
}
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\Pivot;

class ArtistLead extends Pivot
{
use HasFactory;

protected $fillable = [
'lead_id',
'artist_id',
'accept',
'refuse',
];

public function artist(): BelongsTo
{
return $this->belongsTo(Artist::class);
}

public function lead(): BelongsTo
{
return $this->belongsTo(Lead::class);
}
}
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Update repeater
public function leadArtists(): HasMany
{
return $this->hasMany(ArtistLead::class);
}
public function leadArtists(): HasMany
{
return $this->hasMany(ArtistLead::class);
}
25 replies
FFilament
Created by Becker Maxime on 10/27/2023 in #❓┊help
Repeater pivot
Thank you, you saved my life, I lost 4 hours, I could have lost much more. bisous 🙂
7 replies