smorken / storage
Laravel 9 storage provider
Requires
- php: ^8.1
- illuminate/pagination: ^9.0|^10.0|^11.0
- illuminate/support: ^9.0|^10.0|^11.0
- smorken/cache-assist: ^9.0|^10.0
- smorken/model: ^9.0|^10.0
- smorken/support: ^9.0|^10.0
Requires (Dev)
- illuminate/database: ^9.0|^10.0|^11.0
- mockery/mockery: ^1.0
- phpunit/phpunit: ^10.0|^11.0
- smorken/docker: *
This package is auto-updated.
Last update: 2024-12-22 18:29:19 UTC
README
License
This software is open-sourced software licensed under the MIT license
The Laravel framework is open-sourced software licensed under the MIT license
Use
If you use the default storage config of config/storage.php
, the service provider can be automatically loaded via
composer.
If you want to load your own, disable the automatic loading of Smorken\Storage\ServiceProvider
in your project's
composer.json
and create App\Providers\StorageServiceProvider
that extends Smorken\Storage\ServiceProvider
.
Add the service provider to config/app.php
'providers' => [
...
App\Providers\StorageServiceProvider::class,
...
Config
Create a config/storage.php
with contents similar to the following:
<?php
return [
'concrete' => [
\App\Storage\Eloquent\Menu::class => [
'model' => [
'impl' => \App\Models\Eloquent\Menu::class,
'params' => [],
],
],
],
'contract' => [
\App\Contracts\Storage\Menu::class => \App\Storage\Eloquent\Menu::class,
],
];
App\Contracts\Storage\Menu
<?php
interface Menu extends \Smorken\Storage\Contracts\Base
{
//contents
}
App\Storage\Eloquent\Menu
<?php
class Menu extends \Smorken\Storage\Eloquent implements \App\Contracts\Storage\Menu
{
//contents
}
App\Contracts\Models\Menu
<?php
interface Menu extends \Smorken\Model\Contracts\Model
{
//contents
}
App\Models\Eloquent\Menu
<?php
class Menu extends \Smorken\Model\Eloquent implements \App\Contracts\Models\Menu
{
//contents
}