Ava
Ava
FFilament
Created by Sodalis on 12/28/2024 in #❓┊help
Moving everything in /app to /something_else
Hey @Sodalis - To handle the potential issues with packages referencing resourcePath(), you could override Laravel’s default behavior. In your AppServiceProvider, like this:
public function boot(): void
{
app()->useResourcePath(base_path('myproject/core/resources'));
}
public function boot(): void
{
app()->useResourcePath(base_path('myproject/core/resources'));
}
This way, any calls to resourcePath() will point to your custom location instead of the default. What do you think?
23 replies
FFilament
Created by Sodalis on 12/28/2024 in #❓┊help
Moving everything in /app to /something_else
Hey @Sophist-UK - Laravel doesn’t provide a direct $app->useXXXPath() method for resources, but you might be able to work around it by defining custom view paths in Service Providers. Here’s one way to handle it: 1. Set Custom View Paths in Service Providers For each module, you can add something like this in the register() method of its ServiceProvider:
public function register()
{
$this->loadViewsFrom(base_path('myproject/module1/resources/views'), 'module1');
}
public function register()
{
$this->loadViewsFrom(base_path('myproject/module1/resources/views'), 'module1');
}
This would make views in myproject/module1/resources/views accessible with the namespace module1::. 2. CSS/JS with Vite and Tailwind For assets, you can configure Vite or Tailwind to point to module-specific directories. For example, in your vite.config.js:
export default defineConfig({
resolve: {
alias: {
'@module1': '/myproject/module1/resources/assets',
},
},
});
export default defineConfig({
resolve: {
alias: {
'@module1': '/myproject/module1/resources/assets',
},
},
});
You might need to add a Fallback as well but this could allow modular resources folders without straying too far from Laravel’s conventions for views.
23 replies
FFilament
Created by Azad Furkan ŞAKAR on 12/28/2024 in #❓┊help
Is there any method for disabled browser/client validation?
Hey @Azad Furkan ŞAKAR - If you’re looking to disable browser/client-side validation, you could add the novalidate attribute to all Filament forms. If you already have a service provider, like App\Providers\AppServiceProvider, you could modify it instead of creating a new one.
namespace App\Providers;

use Filament\Forms\Form;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Form::configureUsing(function (Form $form) {
$form->attributes(['novalidate' => true]);
});
}
}
namespace App\Providers;

use Filament\Forms\Form;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Form::configureUsing(function (Form $form) {
$form->attributes(['novalidate' => true]);
});
}
}
4 replies
FFilament
Created by Enter on 12/29/2024 in #❓┊help
->searchable() pages blank
Hey @Enter - I see why you might think this issue is related to search functionality, but I have a theory that the black screen issue might actually be tied to Livewire v3.5.18 which seems to have introduced a bug affecting modals. To test this theory, you could try requiring Livewire v3.5.12, which doesn’t seem to have this problem. Update your composer.json to require v3.5.12
"livewire/livewire": "3.5.12"
"livewire/livewire": "3.5.12"
Dont forget to run a composer update for livewire
composer update livewire/livewire
composer update livewire/livewire
Once you’re back on v3.5.12, see if the modal works properly.
10 replies
FFilament
Created by Sodalis on 12/28/2024 in #❓┊help
Moving everything in /app to /something_else
Hey @Sophist-UK You’re correct that Laravel and its ecosystem uses the App namespace and /app directory. Its designed to be customizable and won’t get overwritten during updates, so moving things around and tweaking the namespace should be fine. If you want to change the namespace (like to CustomApp), just update your composer.json like this:
"autoload": {
"psr-4": {
"CustomApp\\": "app/"
}
}
"autoload": {
"psr-4": {
"CustomApp\\": "app/"
}
}
If you do this dont forget to run composer dump-autoload. Filament itself shouldn’t care about the namespace, but if you’re using plugins or third-party packages, it’s worth checking if they make any assumptions about App. For your code generator, it’s a good idea to detect the namespace dynamically, so it works no matter what setup someone has.
23 replies
FFilament
Created by Jpac14 on 12/29/2024 in #❓┊help
Trying to dynamically disable file input, when checkbox is checked
Hey @Jpac14 It looks like the issue might be related to how the TenantFileUpload component processes the disabled() logic dynamically. File inputs in Filament don’t always respond the same way as text inputs when state changes, which could be why your checkbox logic isn’t working as expected. Give this a try, its just my two cents so it may or may not work.
return [
TextInput::make('name')
->label('Name')
->required(),
ColorSwatchInput::make('primary_color')
->label('Primary Color')
->required(),
TenantFileUpload::make('logo')
->label('Logo')
->image()
->maxSize(2048)
->maxFiles(1)
->live(),
Checkbox::make('logo_same_as_favicon')
->label('Use Logo as Favicon')
->live()
->disabled(fn (Get $get) => empty($get('logo')))
->afterStateUpdated(function (bool $state, Set $set) {
if ($state) {
$set('favicon', []); // Clear favicon when checkbox is checked
}
}),
TenantFileUpload::make('favicon')
->label('Favicon')
->helperText('A small icon that appears in the browser tab')
->image()
->maxSize(2048)
->maxFiles(1)
->extraAttributes([
'x-bind:disabled' => "state.logo_same_as_favicon", // Dynamically disable using Alpine.js
]),
];
return [
TextInput::make('name')
->label('Name')
->required(),
ColorSwatchInput::make('primary_color')
->label('Primary Color')
->required(),
TenantFileUpload::make('logo')
->label('Logo')
->image()
->maxSize(2048)
->maxFiles(1)
->live(),
Checkbox::make('logo_same_as_favicon')
->label('Use Logo as Favicon')
->live()
->disabled(fn (Get $get) => empty($get('logo')))
->afterStateUpdated(function (bool $state, Set $set) {
if ($state) {
$set('favicon', []); // Clear favicon when checkbox is checked
}
}),
TenantFileUpload::make('favicon')
->label('Favicon')
->helperText('A small icon that appears in the browser tab')
->image()
->maxSize(2048)
->maxFiles(1)
->extraAttributes([
'x-bind:disabled' => "state.logo_same_as_favicon", // Dynamically disable using Alpine.js
]),
];
I am thinking that by adding the extraAttributes property, you can use Alpine.js (x-bind) to directly control the disabled attribute on the file input. This works should dynamically with your checkbox state and avoids limitations with Filament's built-in logic. ofc, you will also need to make sure that Alpine.js is included in your project.
10 replies
FFilament
Created by Hedi on 12/29/2024 in #❓┊help
auto refresh filament page when changing code?
Good Morning @Hedi - Here is my two cents, might be wrong but lets try huh? Double check that your refresh array includes all relavant paths.
refresh: [...refreshPaths, "app/Livewire/**", "resources/views/**"],
refresh: [...refreshPaths, "app/Livewire/**", "resources/views/**"],
3 replies
FFilament
Created by raheel3031 on 12/28/2024 in #❓┊help
Undefined array key 1
Good Morning @raheel3031 - I am gonna throw my two cents in and you can take it for what you think its worth. It seems to me when reading the code you posted that the error is with $urls = $idToUrlsMapping[$page->id]; Maybe update your code to have a fallback if $page->id is missing.
if (isset($idToUrlsMapping[$page->id])) {
$urls = $idToUrlsMapping[$page->id];
$idToUrlsMapping[$page->id] = null;
unset($idToUrlsMapping[$page->id]);
$this->replaceIdToUriMapping($idToUrlsMapping);
} else {
// Handle missing ID gracefully
logger()->warning("Page ID {$page->id} not found in ID to URLs Mapping.");
}
if (isset($idToUrlsMapping[$page->id])) {
$urls = $idToUrlsMapping[$page->id];
$idToUrlsMapping[$page->id] = null;
unset($idToUrlsMapping[$page->id]);
$this->replaceIdToUriMapping($idToUrlsMapping);
} else {
// Handle missing ID gracefully
logger()->warning("Page ID {$page->id} not found in ID to URLs Mapping.");
}
Again this was just my two cent when looking at what you provided. Edit: If you wrong your code with 3x ` then its easier to read. The error might be triggered turing Config/Route clearing because the removeUrlsOf() method is invoked during route clearing, likely via:
Z3d0X\FilamentFabricator\Services\PageRoutesService::removeUrlsOf(Object(Z3d0X\FilamentFabricator\Models\Page))
Z3d0X\FilamentFabricator\Services\PageRoutesService::removeUrlsOf(Object(Z3d0X\FilamentFabricator\Models\Page))
Make sure the Page models that are being passed exist and are valid.
22 replies
FFilament
Created by ngoquocdat on 9/15/2023 in #❓┊help
Disabled tab
I am running into this issue myself, any update on how to disable a Tab?
2 replies
FFilament
Created by Ava on 12/7/2024 in #❓┊help
extraModalFooterActions -> Select
I have not accomplished this in Filament, the image is from Vanilla PHP and Bootstrap. I am new to Filament and Laravel so things that used to be second hand knowledge doesnt exist.
7 replies
FFilament
Created by Ava on 12/4/2024 in #❓┊help
editAction -> form -> columns(2)
Thank you @Leandro Ferreira, I knew you had the answer. I was overlooking it but I searched and didt find in docs.
13 replies
FFilament
Created by Ava on 12/4/2024 in #❓┊help
editAction -> form -> columns(2)
But from editAction modal
13 replies
FFilament
Created by Ava on 12/4/2024 in #❓┊help
editAction -> form -> columns(2)
Like this.
13 replies
FFilament
Created by Ava on 12/4/2024 in #❓┊help
editAction -> form -> columns(2)
No description
13 replies
FFilament
Created by Ava on 12/4/2024 in #❓┊help
editAction -> form -> columns(2)
Yes its a custom page, but I need the form inside the model to have columns just like a normal edit form would have.
13 replies
FFilament
Created by Ava on 12/4/2024 in #❓┊help
editAction -> form -> columns(2)
I dont know what you mean by simple resource.
13 replies
FFilament
Created by Ava on 11/20/2024 in #❓┊help
Section->headerActions->Select
Worked beautifully @dissto - Thank you.
16 replies
FFilament
Created by Ava on 11/20/2024 in #❓┊help
Section->headerActions->Select
hehe okay, thanks.
16 replies
FFilament
Created by Ava on 11/20/2024 in #❓┊help
Section->headerActions->Select
And if I dont have a src folder?
16 replies
FFilament
Created by Ava on 11/20/2024 in #❓┊help
Section->headerActions->Select
Sorry I am very new to this, where would I put this file? or component?
16 replies