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

make:filament-resource fails when using the --generate option #11606

Closed
RalphMRivera opened this issue Feb 27, 2024 · 2 comments · Fixed by #11604
Closed

make:filament-resource fails when using the --generate option #11606

RalphMRivera opened this issue Feb 27, 2024 · 2 comments · Fixed by #11604
Labels
bug Something isn't working low priority unconfirmed
Milestone

Comments

@RalphMRivera
Copy link
Contributor

Package

filament/filament

Package Version

v3.2.39

Laravel Version

10.46.0

Livewire Version

v3.4.6

PHP Version

8.2.15

Problem description

The make:filament-resource command fails when using the --generate option.

Expected behavior

A resource should be generated with a table and form pre-populated as per Automatically generating forms and tables.

Steps to reproduce

  • Install filament
  • Use php artisan make:model Flight --migration to create a model and migration.
  • Add a few columns to the Flight migration.
  • Migrating the database or not does not affect this bug. I tried both ways.
  • Run php artisan make:filament-resource Flight --generate

Reproduction repository

https://github.com/RalphMRivera/filament-issue

Relevant log output

~/Projects/filament-issue [main] php artisan make:filament-resource Flight --generate

   TypeError

  Filament\Commands\MakeResourceCommand::getModelSchema(): Return value must be of type Illuminate\Support\Facades\Schema, Illuminate\Database\Schema\SQLiteBuilder returned

  at vendor/filament/support/src/Commands/Concerns/CanReadModelSchemas.php:27
     23▕     protected function getModelSchema(string $model): Schema
     24▕     {
     25▕         return app($model)
     26▕             ->getConnection()
  ➜  27▕             ->getSchemaBuilder();
     28▕     }
     29▕
     30▕     protected function getModelTable(string $model): string
     31▕     {

      +14 vendor frames

  15  artisan:35
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
@dreftas
Copy link
Contributor

dreftas commented Feb 28, 2024

Same issue for me.

@petrisorcraciun
Copy link

petrisorcraciun commented Feb 28, 2024

#11604

@zepfietje zepfietje linked a pull request Feb 28, 2024 that will close this issue
1 task
@zepfietje zepfietje added this to the v3 milestone Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority unconfirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants