You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
-
77
63
# Usage
78
64
With the package installed you can now have access to all the features of this package. There are a few different areas to configure.
79
65
@@ -133,7 +119,29 @@ You can use the default `php artisan make:model` command with a new `--filemaker
133
119
php artisan make:model MyNewModel --filemaker
134
120
```
135
121
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.
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:
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
137
145
138
146
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!
139
147
@@ -143,7 +151,7 @@ Our goal is to be able to use any of these Eloquent features which make sense, s
143
151
144
152
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.
145
153
146
-
####Things that don't work
154
+
### Things that don't work
147
155
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.
0 commit comments