RickDBCN / filament-email

Log emails in your Filament project
https://filament-email-demo.marcogermani.it/
MIT License
83 stars 22 forks source link

[Bug]: Incompatibilidad de tipos en getNavigationIcon() con Filament v3 y Laravel 11 #73

Closed codebyDanielDev closed 2 months ago

codebyDanielDev commented 3 months ago

What happened?

Descripción del problema

Al intentar instalar y utilizar el plugin rickdbcn/filamento-email con Laravel 11 y Filament v3, se produce un error de incompatibilidad de tipos en el método getNavigationIcon().

Entorno

How to reproduce the bug

Al momento de la instalación, me sale este error Symfony\Component\ErrorHandler\Error\FatalError Declaration of RickDBCN\FilamentEmail\Filament\Resources\EmailResource::getNavigationIcon(): Illuminate\Contracts\Support\Htmlable|string|null must be compatible with Filament\Resources\Resource::getNavigationIcon(): ?string vendor/rickdbcn/filament-email/src/Filament/Resources/EmailResource.php :48

Package Version

1.5

PHP Version

8.3.9

Laravel Version

11.18.1

Which operating systems does with happen with?

Linux

Notes

Tengo ese error, la verdad estoy adentrándome en Filament, y quizá sea alguna cosa mía, Si es error mío, favor de decirmelo, gracias.

marcogermani87 commented 3 months ago

Hi @codebyDanielDev,

from my checks, the actual method is compatbile with abstract class Resource.php from Filament core:

public static function getNavigationIcon(): string | Htmlable | null
{
    return static::$navigationIcon;
}

You can show your "php artisan about" results for more info?

P.s. please, expose the complete version number of Filament package

codebyDanielDev commented 3 months ago

`PS /home/carlos-daniel/Herd/laravel/JetStart> php artisan about

Environment ......................................................................................................................................
Application Name ......................................................................................................................... Laravel
Laravel Version .......................................................................................................................... 11.18.1
PHP Version ................................................................................................................................ 8.3.9
Composer Version ........................................................................................................................... 2.7.1
Environment ................................................................................................................................ local
Debug Mode ............................................................................................................................... ENABLED
URL ............................................................................................................................... 127.0.0.1:8000
Maintenance Mode ............................................................................................................................. OFF
Timezone ............................................................................................................................ America/Lima
Locale ........................................................................................................................................ es

Cache ............................................................................................................................................
Config ................................................................................................................................ NOT CACHED
Events ................................................................................................................................ NOT CACHED
Routes ................................................................................................................................ NOT CACHED
Views ..................................................................................................................................... CACHED

Drivers ..........................................................................................................................................
Broadcasting ................................................................................................................................. log
Cache ...................................................................................................................................... redis
Database .................................................................................................................................. sqlite
Logs .............................................................................................................................. stack / single
Mail ......................................................................................................................................... log
Queue ...................................................................................................................................... redis
Session .................................................................................................................................... redis

Filament .........................................................................................................................................
Packages ......................................................................................... filament, forms, notifications, support, tables
Version .................................................................................................................................. v3.2.40
Views ........................................................................................................................ PUBLISHED: filament

Themes ...........................................................................................................................................
Themes ............................................................................................................ default, dracula, nord, sunset
Version .................................................................................................................................. v3.0.23

Livewire .........................................................................................................................................
Livewire .................................................................................................................................. v3.5.4

Spatie Permissions ...............................................................................................................................
Features Enabled ......................................................................................................................... Default
Version .................................................................................................................................... 6.9.0

PS /home/carlos-daniel/Herd/laravel/JetStart> `

Hola,

Este es, voy a probarlo nuevamente, y envío que me sale. Gracias

codebyDanielDev commented 3 months ago

Hola, estoy probandolo y estos son los pasos que estoy siguiendo:

composer require rickdbcn/filament-email

php artisan vendor:publish --tag="filament-email-migrations" php artisan migrate php artisan vendor:publish --tag="filament-email-config"

Despues en app/Providers/Filament/AdminPanelProvider.php

image

Me dirijo al panel y me sale este error: image

Al parecer ya lo solucione, pero no tengo acceso a esta parte del codigo hice lo siguiente: vendor/rickdbcn/filament-email/src/Filament/Resources/EmailResource.php: image de eso lo cambie a esto image

No se, quiza sea algun error mio interno o la verdad no se,

image y si funciono, Como te digo estoy empezando con Filament, así que puede que sea un error mío, Si es error mío, por favor decirmelo, gracias.

Lea23VC commented 2 months ago

No deberías modificar archivos del vendor, estos pertenecen a la librería. Al momento de querer actualizar o descargar el paquete, esos cambios se perderán, y no deberían formar parte de tu git.

Tuve el mismo problema, este venía de phpunit/phpunit, en su versión 11.3.0 en mi composer.json, me daba tu mismo error, y se solucionó con un downgrade a 10.5.29.

For english speakers: You should not modify files in the vendor directory, as they belong to the library. When you update or download the package, those changes will be lost, and they should not be part of your git repository

I had the same problem, which came from phpunit/phpunit in version 11.3.0 in my composer.json. I got the same error as you, and it was resolved by downgrading to 10.5.29

codebyDanielDev commented 2 months ago

@Lea23VC

Hola, si lo sé, solo fue para buscar una solución, igual desinstale el paquete, espero que pronto se solucione este error, igual solo fue en un entorno de prueba para probar el paquete y no sea algún otro error. Igual gracias.

Hi, I know, I just wanted to find a solution, I uninstalled the package anyway, I hope this error is fixed soon, maybe it was just in a test environment to test the package and it's not some other error. Thanks anyway.

RickDBCN commented 2 months ago

Could we keep this in English, so everyone can follow along? Is your issue resolved @codebyDanielDev?

RickDBCN commented 2 months ago

closing due to inactivity