warpig
warpig
FFilament
Created by warpig on 9/15/2024 in #❓┊help
Spatie media library responsive images
Could somebody please walk me through the process of creating responsive images using spatie media library plugin for filament on v3? all of a sudden the live version of my blog decided to stop showing images on mobile devices so now i have to generate images with different sizes. this turned out to be a faulty css (my mistake) Even though i refreshed the browser a few times on my phone nothing worked. Desktop version is doing fine. So anyway, i decided to try the spatie media library plugin but already it seems impossible to comprehend off of just the documentation. 😎 https://filamentphp.com/plugins/filament-spatie-media-library
11 replies
FFilament
Created by warpig on 5/11/2024 in #❓┊help
500 server error after updating user model
i created a user on my production server
php artisan make:filament-user
php artisan make:filament-user
to let the admin sign in, then i implemented this code on my User model:
public function canAccessFilament(): bool

{

return str_ends_with($this->email, '@yourdomain.com')

&& $this->hasVerifiedEmail();

}
public function canAccessFilament(): bool

{

return str_ends_with($this->email, '@yourdomain.com')

&& $this->hasVerifiedEmail();

}
i had to change the class to abstract because i kept seeing this message from laravel extra intelisense:
PHP Fatal error: Class App\Models\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Filament\Models\Contracts\FilamentUser::canAccessPanel) in /var/www/html/coellobranding/app/Models/User.php on line 12
PHP Fatal error: Class App\Models\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Filament\Models\Contracts\FilamentUser::canAccessPanel) in /var/www/html/coellobranding/app/Models/User.php on line 12
so after pushing the changes to the server now there is a 500 server error response 🙂
9 replies
FFilament
Created by warpig on 5/3/2024 in #❓┊help
installing version 3
hi all, i created a new laravel application on windows 10 via:
laravel new filapp
laravel new filapp
and then i tried to install filament
composer require filament/filament:"^3.2" -W php artisan filament:install --panels
composer require filament/filament:"^3.2" -W php artisan filament:install --panels
but that didn't work. i got an error about the "intl" extension on php.ini. however, I was able to install it without a version number. before finding that solution i tried uncommenting these:
extension=zip
extension=intl
extension=zip
extension=intl
and adding this extension: extension=php_intl.dll but at the moment it's not working. i was able to install and even followed a portion of the guide, it got me to create a new patient and owner. but after visiting "admin/patients" i got this on the browser:
The "intl" PHP extension is required to use the [format] method.
The "intl" PHP extension is required to use the [format] method.
the error from "composer update":
- filament/support[v3.2.0, ..., v3.2.72] require ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.
- filament/support[v3.2.0, ..., v3.2.72] require ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.
some warnings before composer update:
HP Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/lib/php/20230831/intl (/usr/lib/php/20230831/intl: cannot open shared object file: No such file or directory), /usr/lib/php/20230831/intl.so (/usr/lib/php/20230831/intl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_intl.dll' (tried: /usr/lib/php/20230831/php_intl.dll (/usr/lib/php/20230831/php_intl.dll: cannot open shared object file: No such file or directory), /usr/lib/php/20230831/php_intl.dll.so (/usr/lib/php/20230831/php_intl.dll.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: Module "zip" is already loaded in Unknown on line 0
HP Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/lib/php/20230831/intl (/usr/lib/php/20230831/intl: cannot open shared object file: No such file or directory), /usr/lib/php/20230831/intl.so (/usr/lib/php/20230831/intl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_intl.dll' (tried: /usr/lib/php/20230831/php_intl.dll (/usr/lib/php/20230831/php_intl.dll: cannot open shared object file: No such file or directory), /usr/lib/php/20230831/php_intl.dll.so (/usr/lib/php/20230831/php_intl.dll.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: Module "zip" is already loaded in Unknown on line 0
i thought i had enabled those extensions? what can i do? i know this has been answered before but uncommenting intl on ini doesn't seem to be working and i restarted nginx prior to running composer update. thanks!
7 replies
FFilament
Created by warpig on 2/15/2024 in #❓┊help
i don't know how to add Spotify playlists on my blog posts
here's the code id like to insert inside the form:
<iframe style="border-radius:12px" src="https://open.spotify.com/embed/playlist/23W49NDyjZPi3Btawkp4AZ?utm_source=generator" width="100%" height="352" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>
<iframe style="border-radius:12px" src="https://open.spotify.com/embed/playlist/23W49NDyjZPi3Btawkp4AZ?utm_source=generator" width="100%" height="352" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>
i am using v2
3 replies
FFilament
Created by warpig on 8/25/2023 in #❓┊help
spatie media library error on a method
Happens in production only, local development is fine.
<img
class="relative lg:absolute lg:inset-0 w-full h-96 lg:h-full object-top object-cover"
src="{{ $latestPost->getMedia('thumbnails') }}"
srcset="{{ $latestPost->getFirstMedia('thumbnails')->getSrcset() }}"
alt="Thumbnail of the newest post"
/>
<img
class="relative lg:absolute lg:inset-0 w-full h-96 lg:h-full object-top object-cover"
src="{{ $latestPost->getMedia('thumbnails') }}"
srcset="{{ $latestPost->getFirstMedia('thumbnails')->getSrcset() }}"
alt="Thumbnail of the newest post"
/>
Error log:
[previous exception] [object] (Error(code: 0): Call to a member function getSrcset() on null at /home/forge/sickofmetal.net/storage/framework/views/dfce3cefa8854d9b8d726a6e80f8ed9e.php:51)
[stacktrace]
[previous exception] [object] (Error(code: 0): Call to a member function getSrcset() on null at /home/forge/sickofmetal.net/storage/framework/views/dfce3cefa8854d9b8d726a6e80f8ed9e.php:51)
[stacktrace]
2 replies
FFilament
Created by warpig on 8/21/2023 in #❓┊help
displaying responsive images using SpatieMediaLibrary plugin for filament
i installed this package a few days ago and updated my Post model accordingly, everything went okay, ran the migrations to no problem, etc but i don't understand how to utilize the responsive images that get created. from the form i can preview the image and the responsive images all of them are generated on my storage folder, but once i get to the front-end those responsive images arent attached on the page. output on the html:
<img src="http://localhost/storage/7/S1WoMcZoiOPEgrKLgDH5jVyqtZfG4Q-metaYnAtMTk4Ni1hbGJ1bXMud2VicA==-.webp">
<img src="http://localhost/storage/7/S1WoMcZoiOPEgrKLgDH5jVyqtZfG4Q-metaYnAtMTk4Ni1hbGJ1bXMud2VicA==-.webp">
Post.php
public function registerMediaConversions(Media $media = null): void
{
$this
->addMediaConversion('preview')
->fit(Manipulations::FIT_CROP, 300, 300)
->nonQueued();
}
}
public function registerMediaConversions(Media $media = null): void
{
$this
->addMediaConversion('preview')
->fit(Manipulations::FIT_CROP, 300, 300)
->nonQueued();
}
}
this is what i have on the form:
SpatieMediaLibraryFileUpload::make('thumbnail')
->collection('thumbnails')
->responsiveImages()
->required(),
SpatieMediaLibraryFileUpload::make('thumbnail')
->collection('thumbnails')
->responsiveImages()
->required(),
this is what i have on the table function and i can't see the thumbnail there,
SpatieMediaLibraryImageColumn::make('thumbnail'),
SpatieMediaLibraryImageColumn::make('thumbnail'),
im using version : * 10.11.3 of the plugin and im currently at v2.17.52 of filament.
11 replies
FFilament
Created by warpig on 8/9/2023 in #❓┊help
not being able to use SpatieTagsColumn due to a non-existing method
Can't view the tags list on admin/tags it throws the following error:
Method Filament\Tables\Columns\SpatieTagsColumn::badge does not exist.
Method Filament\Tables\Columns\SpatieTagsColumn::badge does not exist.
And im aware there are a few channels dedicated to plugins, doesn't seem to be one for spatie-tags, that's why im posting here. So i installed the package My Tag model uses "HasTags" The class is imported on TagResource On the table function:
->columns([SpatieTagsColumn::make('tags')])
->columns([SpatieTagsColumn::make('tags')])
And using SpatieTagsInput on the form to display the form
13 replies
FFilament
Created by warpig on 6/28/2023 in #❓┊help
rendering html iframe with markdown helper
i want to render the below html on my blade but the inlineMarkdown is not letting me.
<iframe class="w-full aspect-video" width="560" height="315" src="https://www.youtube.com/embed/uClPnQM4XQQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<iframe class="w-full aspect-video" width="560" height="315" src="https://www.youtube.com/embed/uClPnQM4XQQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
this is how im rendering my blog post
{!! \Illuminate\Support\Str::inlineMarkdown($post->body) !!}
{!! \Illuminate\Support\Str::inlineMarkdown($post->body) !!}
is not letting me however i can use the tag <font> which is an old html4 tag, like this:
<font color="red">[good](https://google.com)</font>
<font color="red">[good](https://google.com)</font>
and gets rendered correctly and the link works. i was using a spatie-markdown package but it doesn't include a preview and the links work different. if im using filament to create the post how could i get that iframe to render correctly?
21 replies
FFilament
Created by warpig on 6/21/2023 in #❓┊help
embedding videos from youtube
is it possible yet? i've looked at the plug in section but doesn't contain anything neither does the tricks section. im looking to embed youtube videos and have them display on the page. so far the only method that i know of is to use this syntax below, but it doesn't have the play button and goes to youtube i want to view the video on the page.
[![Blinking LEDs](http://img.youtube.com/vi/XAMVzS13HY0/0.jpg)](http://www.youtube.com/watch?v=XAMVzS13HY0 "Blinking LEDs")
[![Blinking LEDs](http://img.youtube.com/vi/XAMVzS13HY0/0.jpg)](http://www.youtube.com/watch?v=XAMVzS13HY0 "Blinking LEDs")
thanks.
15 replies