taz
taz
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
I will try to investigate more to find the precise reason but yes it's very odd ! For the moment I will just try to never launch the two Laravel app at the same time as a workaround. (docker start order) .
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
Thanks you for your time you pointed me toward the good direction !
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
i will try to add --isolated to some of the commands if they are isolatable. I restarted the two laravel app (one by one) and not at same time and it works fine now. The issue araised when they are start at same time.
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
When a command is marked as Isolatable, Laravel will automatically add an --isolated option to the command. When the command is invoked with that option, Laravel will ensure that no other instances of that command are already running. Laravel accomplishes this by attempting to acquire an atomic lock using your application's default cache driver. If other instances of the command are running, the command will not execute; however, the command will still exit with a successful exit status code:
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
From Laravel doc :
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
Are there potential issues if the two laravel app run this simultaneously ?
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
OK I might investigate this. THanks you for your time. I just noticed right now that all my containers restarted in the same time a few hours ago and the bug happended right after. Same last time. Your guess seems right. On update containers starts one after each other (Docker Swarm rolling update). But on VPS reboot they all start together. This is my startup script
#!/usr/bin/env bash
set -e
initialStuff() {
php artisan migrate --force; \
php artisan storage:link; \
php artisan optimize:clear; \
php artisan event:cache; \
php artisan config:cache; \
php artisan route:cache; \
php artisan filament:cache-components; \
php artisan icons:cache; \
php artisan app:generate-sitemap https://chatters.tech;
}
echo "Octane Server: $octane_server"
initialStuff
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.frankenphp.conf
#!/usr/bin/env bash
set -e
initialStuff() {
php artisan migrate --force; \
php artisan storage:link; \
php artisan optimize:clear; \
php artisan event:cache; \
php artisan config:cache; \
php artisan route:cache; \
php artisan filament:cache-components; \
php artisan icons:cache; \
php artisan app:generate-sitemap https://chatters.tech;
}
echo "Octane Server: $octane_server"
initialStuff
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.frankenphp.conf
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
Also another hint when I restart the servers its fine for a few days, then the error appears
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
These bug only appear in prod where I have two Laravel container for zero downtime updates. Livewiere is stateless right ?
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
after first click and the error come from alpineJS Uncaught TypeError: Cannot read properties of undefined (reading 'dispatchEvent')
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
I have also this error here on the frontend where a button click dont do nothing
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
It's a simple resource
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
Section::make(__('Credentials'))
->description(__('Set a username and a password. The chatter will need these credentials to access its dashboard and start chatting.'))
->columns([
'default' => 1,
'lg' => 2,
])
->schema([
TextInput::make("username")
->label(__('Username'))
->required()
->minLength(4)
->maxLength(30)
->unique(table: Chatter::class, ignoreRecord: true),
TextInput::make('clear_password')
->label(__('Password'))
->afterStateHydrated(function ($state, callable $set, Chatter $chatter) {
if (empty($state)) {
$set('clear_password', $chatter->clear_password);
}
})
->password()
->revealable()
->required()
->rules([Rules\Password::default(), fn(Chatter $chatter): Closure => function( string $attribute, $value, Closure $fail) use ($chatter) {
$user = auth('web')->user();
if (!$chatter->exists && $user->numberOfChattersLimitHit()) {
$fail(trans('validation.custom.chatters.max_chatters'));
return;
}
},
])
->minLength(8)
->maxLength(30),
])
];
Section::make(__('Credentials'))
->description(__('Set a username and a password. The chatter will need these credentials to access its dashboard and start chatting.'))
->columns([
'default' => 1,
'lg' => 2,
])
->schema([
TextInput::make("username")
->label(__('Username'))
->required()
->minLength(4)
->maxLength(30)
->unique(table: Chatter::class, ignoreRecord: true),
TextInput::make('clear_password')
->label(__('Password'))
->afterStateHydrated(function ($state, callable $set, Chatter $chatter) {
if (empty($state)) {
$set('clear_password', $chatter->clear_password);
}
})
->password()
->revealable()
->required()
->rules([Rules\Password::default(), fn(Chatter $chatter): Closure => function( string $attribute, $value, Closure $fail) use ($chatter) {
$user = auth('web')->user();
if (!$chatter->exists && $user->numberOfChattersLimitHit()) {
$fail(trans('validation.custom.chatters.max_chatters'));
return;
}
},
])
->minLength(8)
->maxLength(30),
])
];
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
public static function getForm(): array
{
return [
Section::make(__('Personal information'))
->columns([
'default' => 1,
'lg' => 2,
])
->schema([
TextInput::make('name')
->label(__('Name'))
->required()
->unique(table: Chatter::class, ignoreRecord: true, modifyRuleUsing: function (Unique $rule) {
return $rule->where('user_id', Auth::user()->id);
})
->minLength(4)
->maxLength(30)
->autofocus(),
TextInput::make('email')
->label('Email')
->required()
->prefixIcon('heroicon-s-envelope')
->minLength(4)
->helperText(__('The address will be used to send an onboarding email to the chatter.'))
->maxLength(320)
->email(),
]),
public static function getForm(): array
{
return [
Section::make(__('Personal information'))
->columns([
'default' => 1,
'lg' => 2,
])
->schema([
TextInput::make('name')
->label(__('Name'))
->required()
->unique(table: Chatter::class, ignoreRecord: true, modifyRuleUsing: function (Unique $rule) {
return $rule->where('user_id', Auth::user()->id);
})
->minLength(4)
->maxLength(30)
->autofocus(),
TextInput::make('email')
->label('Email')
->required()
->prefixIcon('heroicon-s-envelope')
->minLength(4)
->helperText(__('The address will be used to send an onboarding email to the chatter.'))
->maxLength(320)
->email(),
]),
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
"To" node in Morph dom is assigned to this text '\n\n' ? Is this an escaping issue ?
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
<?php

namespace App\Filament\Resources\ChatterResource\Pages;

use App\Filament\Resources\ChatterResource;
use App\Models\Chatter;
use Filament\Actions;
use Filament\Actions\StaticAction;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\ViewRecord;
use Illuminate\Contracts\Support\Htmlable;


class ViewChatter extends ViewRecord
{
protected static string $resource = ChatterResource::class;

public function getTitle(): string | Htmlable
{
/** @var Post */
$record = $this->getRecord();

return $record->name;
}

protected function getHeaderActions(): array
{
return [
Actions\EditAction::make()
->icon('heroicon-o-pencil-square')
->slideOver(),
Actions\DeleteAction::make()
->icon('heroicon-o-trash')
->color('danger')

];
}
}
<?php

namespace App\Filament\Resources\ChatterResource\Pages;

use App\Filament\Resources\ChatterResource;
use App\Models\Chatter;
use Filament\Actions;
use Filament\Actions\StaticAction;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\ViewRecord;
use Illuminate\Contracts\Support\Htmlable;


class ViewChatter extends ViewRecord
{
protected static string $resource = ChatterResource::class;

public function getTitle(): string | Htmlable
{
/** @var Post */
$record = $this->getRecord();

return $record->name;
}

protected function getHeaderActions(): array
{
return [
Actions\EditAction::make()
->icon('heroicon-o-pencil-square')
->slideOver(),
Actions\DeleteAction::make()
->icon('heroicon-o-trash')
->color('danger')

];
}
}
32 replies
FFilament
Created by taz on 10/15/2024 in #❓┊help
Button Edit Action disappear after first click
After a few debuggin using debugger To is assigned to a Text Node in Morph.js so I cant call setAttribute on it ? But whi it is set to a Text Node ?
32 replies
FFilament
Created by taz on 8/8/2024 in #❓┊help
Forms hint opens a modal
Works perfectly, thanks you !
5 replies
FFilament
Created by taz on 7/30/2024 in #❓┊help
FIlament Blade components outside filament. Change default primary color
Solved my problem. Thanks you @Leandro Ferreira
9 replies
FFilament
Created by taz on 8/7/2024 in #❓┊help
Livewire components that implements HasForms can have multiple forms ?
4 replies