DarkKnight
DarkKnight
FFilament
Created by DarkKnight on 2/22/2024 in #❓┊help
How to add inline() to TextInput?
Its all in the title 🙂
3 replies
FFilament
Created by DarkKnight on 12/24/2023 in #❓┊help
How can I dispatch a livewire event from a table?
The table function is static, thus I cant call $this->dispatch('something').
26 replies
FFilament
Created by DarkKnight on 12/23/2023 in #❓┊help
How can I redirect on notifications action?
Notification::make()
->title('Saved successfully')
->success()
->body('Changes to the post have been saved.')
->actions([
\Filament\Notifications\Actions\Action::make('view')
->button()
->action($this->redirect(TestResource::getUrl('edit', ['record' => $this->record->id]))),
])
->sendToDatabase($recipient);
Notification::make()
->title('Saved successfully')
->success()
->body('Changes to the post have been saved.')
->actions([
\Filament\Notifications\Actions\Action::make('view')
->button()
->action($this->redirect(TestResource::getUrl('edit', ['record' => $this->record->id]))),
])
->sendToDatabase($recipient);
I currently have this but when i press the the View button nothing happens. This tells me that the default behavior doesnt allow for redirects. Is this at all possible to do?
10 replies
FFilament
Created by DarkKnight on 12/15/2023 in #❓┊help
How can I add Actions to the body of Sections?
Its all in the title:)
17 replies
FFilament
Created by DarkKnight on 12/12/2023 in #❓┊help
extraAttributes on Form components
Toggle::make('is_ended')
->label('Show active projects only')
->default(true)
->columnSpan(1)
->extraAttributes([
'class' => 'align-self-center',
])
Toggle::make('is_ended')
->label('Show active projects only')
->default(true)
->columnSpan(1)
->extraAttributes([
'class' => 'align-self-center',
])
The class exists in my theme, I ran the build command, and yet its not executet/found when the page loads 🤔
100 replies
FFilament
Created by DarkKnight on 12/12/2023 in #❓┊help
Original filename in preview and download, but custom stored filename in FileUpload
I basically want to change the name of the file that is being downloaded. But I cant find the function that does that. My suspicions say that its only done by JS. But if that is the case then how can I change the name of the file being downloaded? (I dont want to change anything in the database). Even better, I want to show the original name of the file in the preview, but not when viewing on another tab (I have secure storage via controller)
48 replies
FFilament
Created by DarkKnight on 12/8/2023 in #❓┊help
How can I dispatch event from row Action in a Resource?
I want to dispatch an event from a row Action of a Table, so it can be listened in my widget. How can I do that?
2 replies
FFilament
Created by DarkKnight on 12/8/2023 in #❓┊help
How do I execute Alpine code when clicking on a modal?
As the title says, I want to execute some custom alpine code, or at the very least some plain JS code in general. Is that possible, if so, how?
11 replies
FFilament
Created by DarkKnight on 11/29/2023 in #❓┊help
Help needed with Filters Above Content
Does anyone mind sharing the code of: https://filamentphp.com/docs/3.x/tables/filters/layout#displaying-filters-above-the-table-content ? I cant get the filters to span horizontally on top. I always have weird glitches when viewing from different devices.
12 replies
FFilament
Created by DarkKnight on 11/29/2023 in #❓┊help
FileUpload doesnt save to public
The problem is, the files only get saved to "storage/app/public" and not "public/storage". Therefore, you cant preview it or open it at all
FileUpload::make('attachment')
->required()
->multiple()
->columnSpan(2)
->disk('public')
->visibility('private')
->storeFileNamesIn('attachment_file_names')
->enableDownload()
->maxSize(25600)
FileUpload::make('attachment')
->required()
->multiple()
->columnSpan(2)
->disk('public')
->visibility('private')
->storeFileNamesIn('attachment_file_names')
->enableDownload()
->maxSize(25600)
I ran php artisan storage:link, and the url in .env is correct My filesystems file:
<?php

return [
'default' => env('FILESYSTEM_DISK', 'local'),


'disks' => [

'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],

'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],

's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],

],

'links' => [
public_path('storage') => storage_path('app/public'),
],

];
<?php

return [
'default' => env('FILESYSTEM_DISK', 'local'),


'disks' => [

'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],

'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],

's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],

],

'links' => [
public_path('storage') => storage_path('app/public'),
],

];
3 replies
FFilament
Created by DarkKnight on 11/28/2023 in #❓┊help
Filters layout not appearing properly above content
No description
117 replies
FFilament
Created by DarkKnight on 11/12/2023 in #❓┊help
How can I populate table based on user id?
For example, in my table I have 3 rows a,b,user_id. I want to be able to fill the table with rows that have the same user_id?
5 replies
FFilament
Created by DarkKnight on 9/16/2023 in #❓┊help
Action with AlpineJS
My issue is that when I click on the empty part of the widget its like I pressed the action. In other words, the action is supposed to do something, and whether I press the action or the empty parts of the widget, its the same. Any idea why? Im thinking it has something to do with the <div> but I dont know how else to structure it.
<x-filament-widgets::widget>
<div wire:poll="stats" x-data="{
isPlaying: false,
playRadio: function() {
const mediaPlayer = this.$refs.radioPlayer; // Use Alpine.js $refs
if (mediaPlayer) {
mediaPlayer.play()
.catch(error => {
// Handle the error (e.g., display a message to the user)
console.error('Error playing audio:', error);
});
}
}
}">

<!-- Go to the radio page, using inspect element find the audio file -->
<audio id="radioPlayer" x-ref="radioPlayer">
<source src="https://live.akous.gr/akousbreeze" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

<x-filament::section>
<div wire:poll="stats">
Song: {{ $this->stats()['songTitle'] }}
</div>

<!-- Trigger the action when the section is clicked -->
<div x-on:click="playRadio()">
{{ $this->testAction }}
<x-filament-actions::modals />
<!-- Remove $this->testAction expression -->
</div>

</x-filament::section>
</div>
</x-filament-widgets::widget>
<x-filament-widgets::widget>
<div wire:poll="stats" x-data="{
isPlaying: false,
playRadio: function() {
const mediaPlayer = this.$refs.radioPlayer; // Use Alpine.js $refs
if (mediaPlayer) {
mediaPlayer.play()
.catch(error => {
// Handle the error (e.g., display a message to the user)
console.error('Error playing audio:', error);
});
}
}
}">

<!-- Go to the radio page, using inspect element find the audio file -->
<audio id="radioPlayer" x-ref="radioPlayer">
<source src="https://live.akous.gr/akousbreeze" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

<x-filament::section>
<div wire:poll="stats">
Song: {{ $this->stats()['songTitle'] }}
</div>

<!-- Trigger the action when the section is clicked -->
<div x-on:click="playRadio()">
{{ $this->testAction }}
<x-filament-actions::modals />
<!-- Remove $this->testAction expression -->
</div>

</x-filament::section>
</div>
</x-filament-widgets::widget>
62 replies
FFilament
Created by DarkKnight on 9/16/2023 in #❓┊help
How can I customize widgets with tailwind?
I wrote this in the my theme.css file, but I cant seem to render it in my widget's blade file
.fi-wi-background {
background-color: #ff0000;
background-size: cover;
}
.fi-wi-background {
background-color: #ff0000;
background-size: cover;
}
3 replies
FFilament
Created by DarkKnight on 9/15/2023 in #❓┊help
Is Dashboard a livewire component?
No description
63 replies
FFilament
Created by DarkKnight on 9/14/2023 in #❓┊help
Is it possible to add actions to widgets?
I might be missing something, but I went throught the docs and couldnt find something.
17 replies
FFilament
Created by DarkKnight on 6/3/2023 in #❓┊help
Is it possible to have polling on RichText only?
Or only to the whole table?
2 replies