Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: trim(): Argument #1 ($string) must be of type string, array given #20

Open
lutfifirdaus opened this issue Jul 31, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@lutfifirdaus
Copy link

lutfifirdaus commented Jul 31, 2024

What happened?

After i install the package this error appear, I can't find why this error happening, plis help!

https://flareapp.io/share/J7oOAjZ7

image
image
image

How to reproduce the bug

Install recently

Package Version

1.3.0

PHP Version

8.1.25

Laravel Version

10.44

Which operating systems does with happen with?

Windows

Notes

No response

@lutfifirdaus lutfifirdaus added the bug Something isn't working label Jul 31, 2024
@lukas-frey
Copy link
Contributor

Hi, please provide a sample repository where you run into this issue. I can't reproduce it and from the screenshots you provided I can't deduct where the error is happening.

@tsalim13
Copy link

tsalim13 commented Aug 13, 2024

i have the same issue, i just installed the package on a new laravel filamentphp project

@tsalim13
Copy link

@lutfifirdaus have you found a solution

@lutfifirdaus
Copy link
Author

@tsalim13 not found yet, I also try install on fresh filament package but still not working... I've been try debugging it but still not found where the problem is...

@tsalim13
Copy link

@lutfifirdaus i upgraded to laravel 11 and all packages to there latest versions now it' working for me, and php 8.2.13

@Alezx6
Copy link

Alezx6 commented Jan 15, 2025

Problem Summary
When using FilamentPHP, you might encounter an issue where custom views published previously (resources/views/vendor/filament*) conflict with the updated Filament core views. This often happens after running php artisan vendor:publish for views, as the published files are not automatically overwritten when the framework is updated.

This guide explains how to resolve the issue by cleaning up your /vendor directory, removing old custom Filament views, and republishing the views if necessary.

Solution
Step 1: Remove /vendor and Reinstall Dependencies
If you're facing issues after an update, first delete the /vendor folder and reinstall the dependencies using composer install.

bash

Remove the vendor directory

rm -rf vendor

Reinstall all dependencies

composer install
Step 2: Remove Old Published Filament Views
Delete all previously published Filament views located in the resources/views/vendor/filament* directory. These views might conflict with the latest updates in Filament's core.

bash

Remove all Filament-related custom views

rm -rf resources/views/vendor/filament*
Alternatively, if you only want to delete specific problematic files, remove them individually. For example:

Step 3: Re-Publish Filament Views
After cleaning up the old views, you can re-publish Filament's views if necessary. Use the --force flag to ensure that existing files are overwritten.

bash

Re-publish Filament views

php artisan vendor:publish --tag=filament-views --force

Step 4: Clear Laravel Cache
To ensure that Laravel doesn't use cached versions of the removed or updated views, clear the application's caches:

bash
php artisan cache:clear
php artisan view:clear
php artisan config:clear
php artisan route:clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants