Skip to content

Commit aa6af13

Browse files
committed
updated readme to move around stub publishing options
1 parent c48ebe5 commit aa6af13

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

README.md

+24-16
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,6 @@ Install `gearbox-solutions/eloquent-filemaker` in your project using Composer.
6060
composer require gearbox-solutions/eloquent-filemaker
6161
```
6262

63-
## Vendor Publish
64-
This package adds 2 optional vendor publishes that will create a model stub for you that you can customize.
65-
```shell
66-
php artisan vendor:publish --tag=eloquent-filemaker-stubs
67-
// or
68-
php artisan vendor:publish --provider="GearboxSolutions\EloquentFileMaker\Providers\FileMakerConnectionServiceProvider"
69-
```
70-
This publish is best if you are looking to have a mix of FileMaker backed models and another DB backed model.
71-
72-
```shell
73-
php artisan vendor:publish --tag=eloquent-filemaker-override-model
74-
```
75-
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.
76-
7763
# Usage
7864
With the package installed you can now have access to all the features of this package. There are a few different areas to configure.
7965

@@ -133,7 +119,29 @@ You can use the default `php artisan make:model` command with a new `--filemaker
133119
php artisan make:model MyNewModel --filemaker
134120
```
135121

136-
#### Things that work
122+
### Set FMModel as default with a model stub
123+
124+
If you would like all of your models to be published as FMModel by default so that you don't have to use `--filemaker` in your commands, you can use the following command to publish a model stub that will be used by `php artisan make:model` to set up new models.
125+
126+
```shell
127+
php artisan vendor:publish --tag=eloquent-filemaker-override-model
128+
```
129+
This publish will create a `/stubs/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.
130+
131+
If you want to customize the model stub ONLY for when the `---filemaker` flag is used, you can do so with the following command:
132+
133+
```shell
134+
php artisan vendor:publish --tag=eloquent-filemaker-stubs
135+
````
136+
or
137+
```shell
138+
php artisan vendor:publish --provider="GearboxSolutions\EloquentFileMaker\Providers\FileMakerConnectionServiceProvider"
139+
```
140+
This stub publish option is best if you are looking to have a mix of FileMaker backed models and another DB backed model.
141+
142+
143+
144+
### Things that work
137145

138146
The FMModel class extends the base Laravel Model class, and can be used very similarly. It supports many standard Eloquent query builder features for working with data, such as where(), find(), id(), orderBy(), delete(), save(), and many more!
139147

@@ -143,7 +151,7 @@ Our goal is to be able to use any of these Eloquent features which make sense, s
143151
144152
Be sure to read [Laravel's Eloquent Documentation](https://laravel.com/docs/8.x/eloquent) to see all the things the Eloquent Model class can do.
145153

146-
#### Things that don't work
154+
### Things that don't work
147155
Because this class extends Model, all of the regular eloquent methods may show as available in your IDE, but some don't make sense in the context of FileMaker's Data API and therefore don't do anything. Some examples of this would be mass updates or raw SQL queries.
148156
149157
### Setting a layout

0 commit comments

Comments
 (0)