filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.22k stars 2.96k forks source link

Text, md file inside Resource directory throws error #3395

Closed khanakia closed 2 years ago

khanakia commented 2 years ago

Package

filament/filament

Package Version

2.0

Laravel Version

9

Livewire Version

2.10.6

PHP Version

8

Problem description

When i have some other files e.g. txt, md inside the resources directory it throws error. It should only include PHP files and ignore all other extensions.

Screenshot 2022-08-05 at 7 48 10 PM Screenshot 2022-08-05 at 7 47 58 PM

Expected behavior

There should be no error

Steps to reproduce

Just add any text or md file inside Resources directory

Reproduction repository

https://github.com/khanakia/filament-error

Relevant log output

ReflectionException:
Class "App\Filament\Resources\CompanyResource\RelationManagers\Readme.md" does not exist

  at /Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/filament/filament/src/FilamentServiceProvider.php:145
  at ReflectionClass->__construct('App\\Filament\\Resources\\CompanyResource\\RelationManagers\\Readme.md')
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/filament/filament/src/FilamentServiceProvider.php:145)
  at Filament\FilamentServiceProvider->registerComponents()
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/filament/filament/src/FilamentServiceProvider.php:81)
  at Filament\FilamentServiceProvider->packageRegistered()
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/spatie/laravel-package-tools/src/PackageServiceProvider.php:36)
  at Spatie\LaravelPackageTools\PackageServiceProvider->register()
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:686)
  at Illuminate\Foundation\Application->register(object(FilamentServiceProvider))
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php:75)
  at Illuminate\Foundation\ProviderRepository->load(array('Illuminate\\Auth\\AuthServiceProvider', 'Illuminate\\Broadcasting\\BroadcastServiceProvider', 'Illuminate\\Bus\\BusServiceProvider', 'Illuminate\\Cache\\CacheServiceProvider', 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider', 'Illuminate\\Cookie\\CookieServiceProvider', 'Illuminate\\Database\\DatabaseServiceProvider', 'Illuminate\\Encryption\\EncryptionServiceProvider', 'Illuminate\\Filesystem\\FilesystemServiceProvider', 'Illuminate\\Foundation\\Providers\\FoundationServiceProvider', 'Illuminate\\Hashing\\HashServiceProvider', 'Illuminate\\Mail\\MailServiceProvider', 'Illuminate\\Notifications\\NotificationServiceProvider', 'Illuminate\\Pagination\\PaginationServiceProvider', 'Illuminate\\Pipeline\\PipelineServiceProvider', 'Illuminate\\Queue\\QueueServiceProvider', 'Illuminate\\Redis\\RedisServiceProvider', 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider', 'Illuminate\\Session\\SessionServiceProvider', 'Illuminate\\Translation\\TranslationServiceProvider', 'Illuminate\\Validation\\ValidationServiceProvider', 'Illuminate\\View\\ViewServiceProvider', 'Akaunting\\Money\\Provider', 'Barryvdh\\Debugbar\\ServiceProvider', 'BladeUI\\Heroicons\\BladeHeroiconsServiceProvider', 'BladeUI\\Icons\\BladeIconsServiceProvider', 'Filament\\FilamentServiceProvider', 'Filament\\Forms\\FormsServiceProvider', 'Filament\\Notifications\\NotificationsServiceProvider', 'Filament\\Support\\SupportServiceProvider', 'Filament\\Tables\\TablesServiceProvider', 'Inertia\\ServiceProvider', 'Laravel\\Sail\\SailServiceProvider', 'Laravel\\Sanctum\\SanctumServiceProvider', 'Laravel\\Tinker\\TinkerServiceProvider', 'Livewire\\LivewireServiceProvider', 'Carbon\\Laravel\\ServiceProvider', 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider', 'Termwind\\Laravel\\TermwindServiceProvider', 'Spatie\\LaravelIgnition\\IgnitionServiceProvider', 'Spatie\\Permission\\PermissionServiceProvider', 'App\\Providers\\AppServiceProvider', 'App\\Providers\\AuthServiceProvider', 'App\\Providers\\EventServiceProvider', 'App\\Providers\\RouteServiceProvider', 'Spatie\\Permission\\PermissionServiceProvider', 'Barryvdh\\Debugbar\\ServiceProvider'))
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:663)
  at Illuminate\Foundation\Application->registerConfiguredProviders()
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php:17)
  at Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(object(Application))
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:239)
  at Illuminate\Foundation\Application->bootstrapWith(array('Illuminate\\Foundation\\Bootstrap\\LoadEnvironmentVariables', 'Illuminate\\Foundation\\Bootstrap\\LoadConfiguration', 'Illuminate\\Foundation\\Bootstrap\\HandleExceptions', 'Illuminate\\Foundation\\Bootstrap\\RegisterFacades', 'Illuminate\\Foundation\\Bootstrap\\RegisterProviders', 'Illuminate\\Foundation\\Bootstrap\\BootProviders'))
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:153)
  at Illuminate\Foundation\Http\Kernel->bootstrap()
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:137)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(object(Request))
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:111)
  at Illuminate\Foundation\Http\Kernel->handle(object(Request))
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/public/index.php:52)
  at require_once('/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/public/index.php')
     (/Users/khanakia/D1/www/projects/gamerapp/gamer_laravel/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php:16)
github-actions[bot] commented 2 years ago

Hey @khanakia! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public Git repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

khanakia commented 2 years ago

@danharrin the issue is within in the main repo so there is no need to create a reproduction repo.

All you have to do is create any non-PHP files e.g README.md under app/Filamnet/Resources directory. that's all

github-actions[bot] commented 2 years ago

Thank you for providing reproduction steps! Reopening the issue now.