Skip to content

Commit

Permalink
Change command signature
Browse files Browse the repository at this point in the history
  • Loading branch information
likeadeckofcards committed Aug 23, 2024
1 parent 460b7b6 commit cc40dd9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions src/Commands/FMModelMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class FMModelMakeCommand extends LaravelModelMakeCommand
{
protected $name = 'make:fm-model';
protected $name = 'make:model';

/**
* The console command description.
Expand All @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit cc40dd9

Please sign in to comment.