Skip to content

Commit

Permalink
Update config style
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed Nov 20, 2020
1 parent d81cfce commit 45592d6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 83 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

All notable changes to `laravel-morph-map-generator` will be documented in this file

## 1.0.1 - 2020-11-20

- update configuration styling

## 1.0.1 - 2020-11-02

- fix for event driven models


## 1.0.0 - 2020-10-30

- initial release
57 changes: 16 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,76 +46,51 @@ This is the contents of the published config file:
```php
return [
/*
|--------------------------------------------------------------------------
| Autogenerate
|--------------------------------------------------------------------------
|
| When enabled, morph maps will be automatically generated when the
| application is booted.
|
* When enabled, morph maps will be automatically generated when the
* application is booted.
*/

'autogenerate' => true,

/*
|--------------------------------------------------------------------------
| Paths
|--------------------------------------------------------------------------
|
| Within these paths, the package will search for models to be included
| in the generated morph map.
|
* Within these paths, the package will search for models to be included
* in the generated morph map.
*/

'paths' => [
app_path(),
],

/*
|--------------------------------------------------------------------------
| Base models
|--------------------------------------------------------------------------
|
| Only models that extend from one of the base models defined here will
| be included in the generated morph map.
|
* Only models that extend from one of the base models defined here will
* be included in the generated morph map.
*/

'base_models' => [
Illuminate\Database\Eloquent\Model::class
Illuminate\Database\Eloquent\Model::class,
],

/*
|--------------------------------------------------------------------------
| Ignored models
|--------------------------------------------------------------------------
|
| When generating the morph map, these models will not be included.
|
* When generating the morph map, these models will not be included.
*/

'ignored_models' => [],


/*
|--------------------------------------------------------------------------
| Cache
|--------------------------------------------------------------------------
|
| Morph maps can be cached, there's a `FilesystemMorphMapCacheDriver` which
| stores the morph map as a file in a directory or you can also use the
| Laravel built-in cache by using `LaravelMorphMapCacheDriver`.
|
| Both drivers have their own config:
| - `FilesystemMorphMapCacheDriver` requires a `path` to store the file
| - `LaravelMorphMapCacheDriver` requires a `key` for storage
|
* Morph maps can be cached, there's a `FilesystemMorphMapCacheDriver` which
* stores the morph map as a file in a directory or you can also use the
* Laravel built-in cache by using `LaravelMorphMapCacheDriver`.
*
* Both drivers have their own config:
* - `FilesystemMorphMapCacheDriver` requires a `path` to store the file
* - `LaravelMorphMapCacheDriver` requires a `key` for storage
*/

'cache' => [
'type' => Spatie\LaravelMorphMapGenerator\Cache\FilesystemMorphMapCacheDriver::class,
'path' => storage_path('app/morph-map-generator'),
]
],
];
```

Expand Down
57 changes: 16 additions & 41 deletions config/morph-map-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,49 @@

return [
/*
|--------------------------------------------------------------------------
| Autogenerate
|--------------------------------------------------------------------------
|
| When enabled, morph maps will be automatically generated when the
| application is booted.
|
* When enabled, morph maps will be automatically generated when the
* application is booted.
*/

'autogenerate' => true,

/*
|--------------------------------------------------------------------------
| Paths
|--------------------------------------------------------------------------
|
| Within these paths, the package will search for models to be included
| in the generated morph map.
|
* Within these paths, the package will search for models to be included
* in the generated morph map.
*/

'paths' => [
app_path(),
],

/*
|--------------------------------------------------------------------------
| Base models
|--------------------------------------------------------------------------
|
| Only models that extend from one of the base models defined here will
| be included in the generated morph map.
|
* Only models that extend from one of the base models defined here will
* be included in the generated morph map.
*/

'base_models' => [
Illuminate\Database\Eloquent\Model::class
Illuminate\Database\Eloquent\Model::class,
],

/*
|--------------------------------------------------------------------------
| Ignored models
|--------------------------------------------------------------------------
|
| When generating the morph map, these models will not be included.
|
* When generating the morph map, these models will not be included.
*/

'ignored_models' => [],


/*
|--------------------------------------------------------------------------
| Cache
|--------------------------------------------------------------------------
|
| Morph maps can be cached, there's a `FilesystemMorphMapCacheDriver` which
| stores the morph map as a file in a directory or you can also use the
| Laravel built-in cache by using `LaravelMorphMapCacheDriver`.
|
| Both drivers have their own config:
| - `FilesystemMorphMapCacheDriver` requires a `path` to store the file
| - `LaravelMorphMapCacheDriver` requires a `key` for storage
|
* Morph maps can be cached, there's a `FilesystemMorphMapCacheDriver` which
* stores the morph map as a file in a directory or you can also use the
* Laravel built-in cache by using `LaravelMorphMapCacheDriver`.
*
* Both drivers have their own config:
* - `FilesystemMorphMapCacheDriver` requires a `path` to store the file
* - `LaravelMorphMapCacheDriver` requires a `key` for storage
*/

'cache' => [
'type' => Spatie\LaravelMorphMapGenerator\Cache\FilesystemMorphMapCacheDriver::class,
'path' => storage_path('app/morph-map-generator'),
]
],
];

0 comments on commit 45592d6

Please sign in to comment.