PHPackages                             caleb/laravel-practice - 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. [Search &amp; Filtering](/categories/search)
4. /
5. caleb/laravel-practice

ActiveLibrary[Search &amp; Filtering](/categories/search)

caleb/laravel-practice
======================

A Laravel practice development package, ready to use out of the box. It simplifies handling responses, filters, services, and exception management.

v1.0.0(1y ago)035MITPHPPHP ^8.2

Since Apr 27Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/caleb-meteor/laravel-practice)[ Packagist](https://packagist.org/packages/caleb/laravel-practice)[ RSS](/packages/caleb-laravel-practice/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Laravel Practice
================

[](#laravel-practice)

A Laravel practice development package, ready to use out of the box. It simplifies handling responses, filters, services, and exception management.

Features
--------

[](#features)

- **Standardized JSON Response**: Unified API response format with request ID tracking
- **Query Filters**: Elegant and reusable query filtering system
- **Service Layer**: Base service class with exception handling capabilities
- **Exception Management**: Comprehensive exception handling with localized messages
- **Model Standardization**: Enhanced Eloquent models with standardized JSON serialization
- **Request Context**: Automatic request ID generation and context management
- **Artisan Commands**: Generate filters and services with custom commands

Requirements
------------

[](#requirements)

- PHP ^8.1
- Laravel ^12.0
- ext-json

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

[](#installation)

Install the package via Composer:

```
composer require caleb/laravel-practice
```

The package will automatically register its service provider.

Configuration
-------------

[](#configuration)

### Publish Language Files

[](#publish-language-files)

```
php artisan vendor:publish --tag=practice-lang
```

### Publish Stubs

[](#publish-stubs)

```
php artisan vendor:publish --tag=practice-stubs
```

Usage
-----

[](#usage)

### 1. Response Trait

[](#1-response-trait)

Use the `Response` trait in your controllers to standardize API responses:

```
