Soldges
Soldges
FFilament
Created by Soldges on 3/31/2024 in #❓┊help
Why is my Action visible?
Hi, I have a InfoList with an action, but why is my action button (edit:not) visible? I dumped $record and the $record->status is 'running'.
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
Section::make('Rate limiting')
->description('Rate limiting settings for this instance.')
->headerActions([
Action::make('stopInstance')
->visible(fn ($record) => $record->status === 'running')
->action(function ($record) {
$record->update(['status' => 'stopped']);
})
->icon('heroicon-m-stop')
->color('danger')
->requiresConfirmation()
])
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
Section::make('Rate limiting')
->description('Rate limiting settings for this instance.')
->headerActions([
Action::make('stopInstance')
->visible(fn ($record) => $record->status === 'running')
->action(function ($record) {
$record->update(['status' => 'stopped']);
})
->icon('heroicon-m-stop')
->color('danger')
->requiresConfirmation()
])
The action button should not be visible...
12 replies
FFilament
Created by Soldges on 12/30/2023 in #❓┊help
Use Filament layout/design outside of the panel
Hi, i have a filament application with the included authentication. I like the design of the login page and I want to use that design for a simple page outside of filamentphp, but in that same application. Any idea how to do that? I just want to have a single page with the same design as the login page. It only has different form fields. Thanks!
3 replies
FFilament
Created by Soldges on 9/12/2023 in #❓┊help
auth()->check is false
Hi, I have a simple Trait in my Filament V3 app.
<?php

namespace App\Traits;

use Illuminate\Database\Eloquent\Builder;

trait BelongsToTeam
{
public static function bootBelongsToTeam()
{
dd(auth()->check());
if (auth()->check()) {
static::creating(function ($model) {
$model->team_id = auth()->user()->team->id;
});

static::addGlobalScope('team_id', function (Builder $builder) {
return $builder->where('team_id', auth()->user()->team->id);
});
}
}
}
<?php

namespace App\Traits;

use Illuminate\Database\Eloquent\Builder;

trait BelongsToTeam
{
public static function bootBelongsToTeam()
{
dd(auth()->check());
if (auth()->check()) {
static::creating(function ($model) {
$model->team_id = auth()->user()->team->id;
});

static::addGlobalScope('team_id', function (Builder $builder) {
return $builder->where('team_id', auth()->user()->team->id);
});
}
}
}
auth()->ckeck is false, but why? Any idea?
16 replies
FFilament
Created by Soldges on 9/11/2023 in #❓┊help
Buttons on the right side
Is it possible to move the buttons to the right side? I think it looks much better together with aside(). https://imgsh.net/a/xYjzzeG.png Would like to have it on the right side instead of left. This is a normale Resource no custom page
11 replies