From cc40dd917dba838913a12aa42417d13070a6561b Mon Sep 17 00:00:00 2001 From: Michael Deck Date: Tue, 2 Apr 2024 10:31:11 -0400 Subject: [PATCH] Change command signature --- README.md | 6 ++++-- src/Commands/FMModelMakeCommand.php | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3762f66..c2f6fca 100644 --- a/README.md +++ b/README.md @@ -75,12 +75,14 @@ php artisan vendor:publish --tag=eloquent-filemaker-override-model This publish will create a `model.stub` that will be used by `php artisan make:model` to set up new models. You should use this on projects that will only have models backed by FileMaker. ## Alternatively, use new make command -Alternatively, you can use the new `make:fm-model` command. All options available to Laravel's native `make:model` command are also available to `make:fm-model` command. +Alternatively, you can use the default `make:model` command with a new `--filemaker` flag. All options available to Laravel's native `make:model` command are still available for use. ```shell -php artisan make:fm-model Model +php artisan make:model Model --filemaker ``` +Note: If the `--filemaker` flag is not used, the model will be created as a standard Laravel model. + # Usage With the package installed you can now have access to all the features of this package. There are a few different areas to configure. diff --git a/src/Commands/FMModelMakeCommand.php b/src/Commands/FMModelMakeCommand.php index 85b0264..9f22bd4 100644 --- a/src/Commands/FMModelMakeCommand.php +++ b/src/Commands/FMModelMakeCommand.php @@ -7,7 +7,7 @@ class FMModelMakeCommand extends LaravelModelMakeCommand { - protected $name = 'make:fm-model'; + protected $name = 'make:model'; /** * The console command description. @@ -32,7 +32,7 @@ public function getStub() throw new \RuntimeException('This model type is not yet supported by Eloquent FileMaker.'); } - $stub = $this->resolveStubPath('/stubs/fm.model.stub'); + $stub = $this->resolveFMStubPath('/stubs/fm.model.stub'); } return $stub; @@ -44,7 +44,7 @@ public function getStub() * @param string $stub * @return string */ - protected function resolveStubPath($stub) + protected function resolveFMStubPath($stub) { return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) ? $customPath