alokadev / easypack
EasyPack: a Laravel 12 extensible package
Requires
- php: ^8.2
- illuminate/support: ^12.0
- spatie/laravel-medialibrary: ^11.0
- spatie/laravel-permission: ^6.0
This package is not auto-updated.
Last update: 2025-09-28 16:57:36 UTC
README
EasyPack is a Laravel package designed to simplify the setup of commonly used Spatie packages: spatie/laravel-permission
and spatie/laravel-medialibrary
. It provides an Artisan command to publish their necessary assets (configurations and migrations) and guides the user through the final setup steps.
Features
- Automatically includes
spatie/laravel-permission
andspatie/laravel-medialibrary
as dependencies. - Provides an
easypack:install
Artisan command to:- Publish configuration files for
spatie/laravel-permission
(asconfig/permission.php
). - Publish configuration files for
spatie/laravel-medialibrary
(asconfig/medialibrary.php
). - Publish migration files for both Spatie packages to your application's
database/migrations
directory. - Publish its own configuration file (if available) as
config/easypack.php
.
- Publish configuration files for
- Guides users to configure their database and run migrations.
Installation
-
Require the package via Composer in your Laravel project:
composer require alokadev/easypack
-
The package uses Laravel's auto-discovery, so the service provider will be registered automatically.
Setup
After installing the package, run the easypack:install
Artisan command:
php artisan easypack:install
This command will perform the following actions:
- Publish Configuration Files:
spatie/laravel-permission
config will be published toconfig/permission.php
.spatie/laravel-medialibrary
config will be published toconfig/medialibrary.php
.- If
easypack
has its own publishable configuration, it will be published toconfig/easypack.php
.
- Publish Migration Files:
- Migrations from
spatie/laravel-permission
will be copied to yourdatabase/migrations
folder. - Migrations from
spatie/laravel-medialibrary
will be copied to yourdatabase/migrations
folder.
- Migrations from
Important: After the command completes, it will remind you to:
- Ensure your database is created and configured in your project's
.env
file. - Run the migrations to create the necessary tables for
laravel-permission
andlaravel-medialibrary
:php artisan migrate
Configuration
- Spatie Laravel Permission: You can customize the behavior of
spatie/laravel-permission
by editing theconfig/permission.php
file. - Spatie Laravel Medialibrary: You can customize the behavior of
spatie/laravel-medialibrary
by editing theconfig/medialibrary.php
file. - EasyPack: If your
alokadev/easypack
package has its own configuration (e.g.,config/easypack.php
within the package), it will be published to your application'sconfig
directory. You can then modify it as needed.
Usage
Once installed and configured, you can use the functionalities provided by spatie/laravel-permission
(for managing roles and permissions) and spatie/laravel-medialibrary
(for managing file uploads and associations) as per their respective documentation.
License
EasyPack is open-sourced software licensed under the MIT license.