BuggerSee
BuggerSee
FFilament
Created by TranceCode on 9/11/2023 in #❓┊help
It's possible use Laravel Octane with Filamentphp?
Hey, just wondering if it is compatible now? Since u seem to work a lot with Octane, do you think it is worth to check out?
9 replies
FFilament
Created by BuggerSee on 9/17/2023 in #❓┊help
Mask is getting applied twice sometimes?
The error is also not in the custom Input Field because i render a TextInput under it to debug and it shows the same problem
7 replies
FFilament
Created by BuggerSee on 9/17/2023 in #❓┊help
Mask is getting applied twice sometimes?
Numbers are saved like this in the database: 0008-9255-8427-9455
7 replies
FFilament
Created by BuggerSee on 9/17/2023 in #❓┊help
Mask is getting applied twice sometimes?
Sure, I'm right now not sure if it is a mask problem. When i add the getOrcidAttribute function, the mistake is gone.
class Member extends Model
{
protected $table = 'members';

protected $fillable = [
'first_name',
'middle_name',
'last_name',
'country',
'institution',
'gender',
'orcid',
'profile_picture_url',

'organizing_member_role_id',
'sc_member_type_id',
'sc_member_since',
'sc_member_until',

'memberable_id',
'memberable_type',
'memberable_email',
];

public function setOrcidAttribute($value): void
{
// Remove any hyphens that might already be in the string
$cleanedValue = str_replace('-', '', $value);

// Insert hyphens at the correct positions
$formattedValue = substr($cleanedValue, 0, 4) . '-'
. substr($cleanedValue, 4, 4) . '-'
. substr($cleanedValue, 8, 4) . '-'
. substr($cleanedValue, 12, 4);

$this->attributes['orcid'] = $formattedValue;
}

// public function getOrcidAttribute($value): string
// {
// return str_replace('-', '', $value);
// }
class Member extends Model
{
protected $table = 'members';

protected $fillable = [
'first_name',
'middle_name',
'last_name',
'country',
'institution',
'gender',
'orcid',
'profile_picture_url',

'organizing_member_role_id',
'sc_member_type_id',
'sc_member_since',
'sc_member_until',

'memberable_id',
'memberable_type',
'memberable_email',
];

public function setOrcidAttribute($value): void
{
// Remove any hyphens that might already be in the string
$cleanedValue = str_replace('-', '', $value);

// Insert hyphens at the correct positions
$formattedValue = substr($cleanedValue, 0, 4) . '-'
. substr($cleanedValue, 4, 4) . '-'
. substr($cleanedValue, 8, 4) . '-'
. substr($cleanedValue, 12, 4);

$this->attributes['orcid'] = $formattedValue;
}

// public function getOrcidAttribute($value): string
// {
// return str_replace('-', '', $value);
// }
7 replies
FFilament
Created by BuggerSee on 9/17/2023 in #❓┊help
Mask is getting applied twice sometimes?
As you can see sometimes the mask is applied twice and changing this number: 9373-4150-3754-7693 to this number: 9373--415-0-37-54-7
7 replies
FFilament
Created by BuggerSee on 8/7/2023 in #❓┊help
Add custom rule to custom input
Fix:
public function getValidationRules(): array
{
return ['required', new OrcidChecksum];
}
public function getValidationRules(): array
{
return ['required', new OrcidChecksum];
}
4 replies
FFilament
Created by BuggerSee on 8/3/2023 in #❓┊help
Custom Input use masking. (Money)
Needed to add this and it apparently works. Thanks!
public function hasMask(): bool
{
return true;
}
public function hasMask(): bool
{
return true;
}
7 replies
FFilament
Created by BuggerSee on 8/3/2023 in #❓┊help
Custom Input use masking. (Money)
public function getMask(): ?Mask
{
$mask = new Mask();

$mask->numeric()
->thousandsSeparator(',')
->decimalSeparator('.')
->decimalPlaces(2);

return $this->evaluate($mask, [
'mask' => app(TextInput\Mask::class),
]);
}
public function getMask(): ?Mask
{
$mask = new Mask();

$mask->numeric()
->thousandsSeparator(',')
->decimalSeparator('.')
->decimalPlaces(2);

return $this->evaluate($mask, [
'mask' => app(TextInput\Mask::class),
]);
}
Like this? Does not work for me unfortunately
7 replies
FFilament
Created by BuggerSee on 7/27/2023 in #❓┊help
Wizard Steps, Create Record doesn't save Relationship
Solution:
Select::make('conference_series_id')
Select::make('conference_series_id')
6 replies
FFilament
Created by BuggerSee on 7/27/2023 in #❓┊help
Wizard Steps, Create Record doesn't save Relationship
Solved it myself, I debugged for 30 mins just because of this simple error.🤦‍♂️ I'm gonna leave this Thread, maybe somebody else finds help in it.
6 replies
FFilament
Created by BuggerSee on 7/27/2023 in #❓┊help
Wizard Steps, Create Record doesn't save Relationship
6 replies
FFilament
Created by BuggerSee on 6/30/2023 in #❓┊help
Display value of Pivot Table
Thanks it worked 🙂
12 replies
FFilament
Created by BuggerSee on 6/30/2023 in #❓┊help
Display value of Pivot Table
12 replies
FFilament
Created by BuggerSee on 6/30/2023 in #❓┊help
Display value of Pivot Table
protected function getTableQuery(): Builder
{
return parent::getTableQuery()->with('sponsorType');
}
protected function getTableQuery(): Builder
{
return parent::getTableQuery()->with('sponsorType');
}
12 replies
FFilament
Created by BuggerSee on 6/30/2023 in #❓┊help
Display value of Pivot Table
Where exactly would i need to do that? Sorry im quite new to this
12 replies
FFilament
Created by BuggerSee on 6/30/2023 in #❓┊help
Display value of Pivot Table
12 replies
FFilament
Created by BuggerSee on 6/30/2023 in #❓┊help
Display value of Pivot Table
Pivot Class: ConferenceSponsor.php
class ConferenceSponsor extends Pivot
{
protected $table = 'conference_sponsor';

protected $fillable = [
'conference_id',
'sponsor_id',
'sponsor_type_id',
];

public function conference()
{
return $this->belongsTo(Conference::class);
}

public function sponsor()
{
return $this->belongsTo(Sponsor::class);
}

public function sponsorType()
{
return $this->belongsTo(SponsorType::class);
}
}
class ConferenceSponsor extends Pivot
{
protected $table = 'conference_sponsor';

protected $fillable = [
'conference_id',
'sponsor_id',
'sponsor_type_id',
];

public function conference()
{
return $this->belongsTo(Conference::class);
}

public function sponsor()
{
return $this->belongsTo(Sponsor::class);
}

public function sponsorType()
{
return $this->belongsTo(SponsorType::class);
}
}
Sponsor model class:
class Sponsor extends Model
{
protected $table = 'sponsors';

protected $fillable = [
'name',
'country',
'logo_url',
];

public function conferences()
{
return $this->belongsToMany(Conference::class, 'conference_sponsor')
->using(ConferenceSponsor::class)
->withPivot('sponsor_type_id');
}
}
class Sponsor extends Model
{
protected $table = 'sponsors';

protected $fillable = [
'name',
'country',
'logo_url',
];

public function conferences()
{
return $this->belongsToMany(Conference::class, 'conference_sponsor')
->using(ConferenceSponsor::class)
->withPivot('sponsor_type_id');
}
}
12 replies
FFilament
Created by BuggerSee on 4/25/2023 in #❓┊help
Set value of Component TextArea in FormAction
thanks for all your help guys
55 replies