acroninja
acroninja
FFilament
Created by Matt on 12/8/2023 in #❓┊help
Refresh repeater items after save form
No idea how many terms and conditions of use I have accepted without ever reading them, probably tens of thousands. Can't blame people, we're all bombarded with rules, regulations, terms and conditions every day. It's impossible to keep track.
20 replies
FFilament
Created by acroninja on 11/13/2024 in #❓┊help
Export download logs out with other auth guards and tenants
I've found it, need to override the filament.actions middleware, just added this to the app service provider and it all works perfectly now.
Route::middlewareGroup('filament.actions', [
'web',
'auth:admin,organisation,associate',
]);
Route::middlewareGroup('filament.actions', [
'web',
'auth:admin,organisation,associate',
]);
8 replies
FFilament
Created by acroninja on 11/13/2024 in #❓┊help
Export download logs out with other auth guards and tenants
Edit, this is NOT the solution. whilst it appeared to work - actually it's wrong. Looking at adding some custom middleware to override the filament.actions middleware which specifies web and auth which is the default guard only.
8 replies
FFilament
Created by acroninja on 11/13/2024 in #❓┊help
Export download logs out with other auth guards and tenants
Seems to work now by redeclaring the same filament route with the additional auth guards. I think by not specifying the domain it will apply to all.
Route::get('filament/exports/{export}/download', DownloadExport::class)
->name('filament.exports.download')
->middleware('auth:admin,organisation,associate');
Route::get('filament/exports/{export}/download', DownloadExport::class)
->name('filament.exports.download')
->middleware('auth:admin,organisation,associate');
8 replies
FFilament
Created by acroninja on 11/8/2024 in #❓┊help
tenant switcher logs me out when using custom domains
Solved this by adding SESSION_DOMAIN to env like this
SESSION_DOMAIN=.mydomain.com
SESSION_DOMAIN=.mydomain.com
Use the root domain for the cookie and it will apply to all domains.
5 replies
FFilament
Created by GizaRex on 10/29/2024 in #❓┊help
Livewire encountered a missing root tag when trying to render a component. On widget
HAHAHA, think i've solved it. I tried running
artisan view:cache
artisan view:cache
and got this error:-
Symfony\Component\Finder\Exception\DirectoryNotFoundException

The "/resources/views/errors" directory does not exist.
Symfony\Component\Finder\Exception\DirectoryNotFoundException

The "/resources/views/errors" directory does not exist.
I just created that directory, and added a .gitignore file inside it so it would be committed. And the error has gone and the views cache OK.
7 replies
FFilament
Created by acroninja on 11/6/2024 in #❓┊help
Export fails when query has with relation
In case anyone else has the problem, a workaround is to remove eager loaded relations on the exporter like this:-
public static function modifyQuery(Builder $query): Builder
{
$query->setEagerLoads([]);
return $query;
}
public static function modifyQuery(Builder $query): Builder
{
$query->setEagerLoads([]);
return $query;
}
3 replies
FFilament
Created by GizaRex on 10/29/2024 in #❓┊help
Livewire encountered a missing root tag when trying to render a component. On widget
I have the same thing happen only on the first load after deployment. Seems that once some view is cached it's fine. Still annoying though
7 replies
FFilament
Created by agaitan026 on 9/21/2024 in #❓┊help
dashboard widget looks weird
+1 same problem with apex charts - but have downgraded that back to 3.1.3 and it's stil the same
18 replies
FFilament
Created by acroninja on 7/9/2024 in #❓┊help
How to call export action from a console command or mailable?
I have used these packages but it means a duplication of code for defining columns. Would be great to be able to trigger the exporter class with a model and query.
4 replies
FFilament
Created by acroninja on 6/22/2024 in #❓┊help
Select Filter with nested relation won't filter
Found the problem. the Select filter name needs to be the attribute name
product_category_id
product_category_id
like this:-
public static function productCategoryFilter($relationship = 'product.productCategory'){
return SelectFilter::make('product_category_id')
->label('Product Category')
->relationship($relationship, 'title')
->native(false)
->searchable()
->preload();
}
public static function productCategoryFilter($relationship = 'product.productCategory'){
return SelectFilter::make('product_category_id')
->label('Product Category')
->relationship($relationship, 'title')
->native(false)
->searchable()
->preload();
}
5 replies
FFilament
Created by acroninja on 6/22/2024 in #❓┊help
Select Filter with nested relation won't filter
No description
5 replies
FFilament
Created by acroninja on 6/7/2024 in #❓┊help
Duplicate navigation items when overriding a package resource.
Haha - idiot user error, resource was being registered twice.
4 replies
FFilament
Created by makmak on 2/21/2024 in #❓┊help
These credentials do not match our records.
hey @makmak did you find out what was happening here. I have the same issue. Reseeded a fresh install and many users reporting These credentials do not match our records. Even though the password is correct
24 replies
FFilament
Created by acroninja on 5/11/2024 in #❓┊help
Checkbox list from relation only orders by title? Solved just use modifyQueryUsing
Oh it's simple, I love FIlament 🙂 ❤️
->relationship('conditions', 'name', modifyQueryUsing: fn (Builder $query) => $query->orderBy('id'))
->relationship('conditions', 'name', modifyQueryUsing: fn (Builder $query) => $query->orderBy('id'))
4 replies
FFilament
Created by acroninja on 4/16/2024 in #❓┊help
How to change the session cookie name between panels?
Can confirm that having separate domain names for each panel solves the problem, and i think is a cleaner approach
5 replies
FFilament
Created by acroninja on 4/16/2024 in #❓┊help
How to change the session cookie name between panels?
Next idea was to get the first segment of the url request, which for each panel is different, but all panels make a request to
/livewire/update
/livewire/update
which won't allow us to identify to which panel this request belongs. Hmmfff. Back to the drawing board. I suspect the only approach that will work is setting a different domain name per panel. This way the session cookies will be unique. Will report back with findings.
5 replies
FFilament
Created by acroninja on 4/16/2024 in #❓┊help
How to change the session cookie name between panels?
On reflection this isn't working because I've put it in the web middleware before SessionStart, but at this point the filament panel hasn't been initialised so won't work. I've also tried putting it in the panel config middleware section
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
DynamicSessionCookie::class,
StartSession::class,
...
], isPersistent:true)
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
DynamicSessionCookie::class,
StartSession::class,
...
], isPersistent:true)
But this results in a redirect each time we login as not all requests are using this middleware - even with isPersistent set, so we end up with 2 different session cookies
5 replies
FFilament
Created by acroninja on 4/16/2024 in #❓┊help
How to change the session cookie name between panels?
I have tried with this middleware but the panel id always returns admin
class DynamicSessionCookie
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
if (function_exists('filament') && filament()->getCurrentPanel()) {
$panelId = filament()->getCurrentPanel()->getId();
$cookieName = Str::slug(config('app.name'), '_').'_'.$panelId.'_session';
config(['session.cookie' => $cookieName]);
}

return $next($request);
}
}
class DynamicSessionCookie
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
if (function_exists('filament') && filament()->getCurrentPanel()) {
$panelId = filament()->getCurrentPanel()->getId();
$cookieName = Str::slug(config('app.name'), '_').'_'.$panelId.'_session';
config(['session.cookie' => $cookieName]);
}

return $next($request);
}
}
5 replies
FFilament
Created by acroninja on 4/13/2024 in #❓┊help
Unable to download export with polymorphic user and custom guard
Update solved. A solution is to override filament.actions group. In a service provider add:-
// Redefine filament actions middleware
Route::middlewareGroup('filament.actions', [
'web',
'auth:admin'>
]);
// Redefine filament actions middleware
Route::middlewareGroup('filament.actions', [
'web',
'auth:admin'>
]);
3 replies