ImpactLab liked a comment+100 XP
1w ago
@Nezo96-39273050 after degging deeper inside laravel command system, i will tell you that you don't need to call
php artisan optimize:clear
because it will be called when you run :
php artisan optimize
look : in OptimiseCommand class (which is responsable of executing optimize command) it will call the cache commands for config, routes ... :
public function handle()
{
$this->components->info('Caching framework bootstrap, configuration, and metadata.');
collect([
'config' => fn () => $this->callSilent('config:cache') == 0,
'events' => fn () => $this->callSilent('event:cache') == 0,
'routes' => fn () => $this->callSilent('route:cache') == 0,
'views' => fn () => $this->callSilent('view:cache') == 0,
])->each(fn ($task, $description) => $this->components->task($description, $task));
$this->newLine();
}
and each of these command will delete the old ones , for example let's look at config:cache at ConfigCacheCommand class it will calll config:clear before cache the new ones :
public function handle()
{
$this->callSilent('config:clear');
$config = $this->getFreshConfiguration();
...
...
}
i wish this response is help you :)
i found these in ArtisanServiceProvider :)
ImpactLab wrote a reply+100 XP
3mos ago
@kianaassenheimer I have got this working in a round-about way with updateTableColumnState:
$this->record->assign($user, MemberPosition::ANALYST);
$component = livewire(MembersTable::class, ['record' => $this->record]);
$component->call('updateTableColumnState', 'position', (string)$user->id, MemberPosition::QUALITY_ASSURANCE->value);
// Assert change has persisted
$pivot = $this->record->members()->where('user_id', $user->id)->first()->pivot;
expect($pivot->position)->toBe(MemberPosition::QUALITY_ASSURANCE);