PHPackages                             ale95m/easy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ale95m/easy

ActiveLibrary

ale95m/easy
===========

API development package with laravel

4.0.0(7mo ago)3152MITPHPPHP ^8.2CI failing

Since May 20Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/ale95m/laravel-easy)[ Packagist](https://packagist.org/packages/ale95m/easy)[ RSS](/packages/ale95m-easy/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (4)Versions (55)Used By (0)

Easy Package for Laravel
========================

[](#easy-package-for-laravel)

> **Speed up your Laravel API development** with repositories, controllers, advanced filtering, and automatic logging.

[![Tests](https://github.com/ale95m/laravel-easy/workflows/Tests/badge.svg)](https://github.com/ale95m/laravel-easy/actions)[![Documentation](https://camo.githubusercontent.com/02784ad6571940aae1b60f2e015d2a35949bd9d21202740ab6954fa512057153/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d6f6e6c696e652d627269676874677265656e2e737667)](https://ale95m.github.io/laravel-easy)[![PHP Version](https://camo.githubusercontent.com/c5e8da782b1a0673c08b4f474108036d2cc973470eed2d5d89d48e8c8475eee6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c75652e737667)](https://php.net)[![Laravel](https://camo.githubusercontent.com/2e8f7955348c3ea73a4d31c15311535852a8092d070a9fcb38a6aaf1c15efc54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d3130253230253743253230313125323025374325323031322d7265642e737667)](https://laravel.com)

Features
--------

[](#features)

- ✅ **Repository Pattern** - Pre-built base repository with CRUD operations
- ✅ **Advanced Filtering** - Multiple operators (=, like, &gt;, &lt;, &gt;=, &lt;=, null) and relation filtering
- ✅ **RESTful Controllers** - Ready-to-use controller with all REST methods
- ✅ **Flexible Authentication** - Driver-based system supporting Passport, Sanctum, JWT, and Session
- ✅ **Automatic Logging** - Track all model changes with user and IP tracking
- ✅ **Code Generators** - Artisan commands to generate repositories, controllers, models, and seeders
- ✅ **Soft Deletes Support** - Built-in soft delete handling
- ✅ **Excel Export** - Export data to Excel with custom formatting
- ✅ **Well Tested** - 80+ tests ensuring reliability

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Quick Start](#quick-start)
- [Core Concepts](#core-concepts)
    - [Easy Repository](#easy-repository)
    - [Easy Controller](#easy-controller)
    - [Filtering System](#filtering-system)
    - [Authentication System](#authentication-system)
    - [Logging System](#logging-system)
- [Artisan Commands](#artisan-commands)
- [Configuration](#configuration)
- [Testing](#testing)
- [Examples](#examples)
- [Documentation](#documentation)

Installation
------------

[](#installation)

### Requirements

[](#requirements)

- PHP &gt;= 8.2
- Laravel 10.x, 11.x, or 12.x

### Install via Composer

[](#install-via-composer)

```
composer require ale95m/laravel-easy
```

### Run Migrations

[](#run-migrations)

Easy includes migrations for logs and files tables:

```
php artisan migrate
```

### Publish Configuration (Optional)

[](#publish-configuration-optional)

```
php artisan vendor:publish --tag=easy-config
```

Quick Start
-----------

[](#quick-start)

Create a complete CRUD in 5 minutes:

### 1. Create Everything at Once

[](#1-create-everything-at-once)

```
# Create model with migration, repository, controller, and seeder
php artisan easy:model Post -m -r -c -s

# Or use the shorthand --easy flag
php artisan easy:model Post --easy
```

This single command creates:

- `app/Models/Post.php` - Model
- `database/migrations/*_create_posts_table.php` - Migration
- `app/Repositories/PostRepository.php` - Repository
- `app/Http/Controllers/PostController.php` - Controller
- `database/seeders/PostSeeder.php` - Seeder

### 2. Define Migration

[](#2-define-migration)

```
Schema::create('posts', function (Blueprint $table) {
    $table->id();
    $table->string('title');
    $table->text('content');
    $table->string('status')->default('draft');
    $table->foreignId('user_id')->constrained();
    $table->timestamps();
    $table->softDeletes();
});
```

Run migration:

```
php artisan migrate
```

### 3. Configure Repository

[](#3-configure-repository)

Edit `app/Repositories/PostRepository.php` to add filters:

```
