PHPackages                             damianulan/laravel-lucent - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. damianulan/laravel-lucent

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

damianulan/laravel-lucent
=========================

Lucent is a laravel extension package. It contains useful traits, helpers, macros, contracts and extensions such as ClassDiscovery and Services.

1.1.7(1mo ago)0519—0%1MITPHPPHP ^8.3CI passing

Since Jul 10Pushed 1mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (10)Versions (21)Used By (1)

Laravel Lucent
==============

[](#laravel-lucent)

[![Laravel](https://camo.githubusercontent.com/afca9778e22c472c6b601fe4bac81424fb1b47a876c1742009544a6bce5c2e38/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6164655f776974682d4c61726176656c2d7265643f7374796c653d666f722d7468652d6261646765)](https://laravel.com) [![License](https://camo.githubusercontent.com/7b032738aeb4a8dd7ec78c4402e078ca8c196b0e528c117bbd78088c9a036988/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75653f7374796c653d666f722d7468652d6261646765)](LICENSE)

Laravel Lucent is a utility package for Laravel applications that bundles a small set of reusable primitives:

- Transaction-oriented service classes
- Composer class discovery via Magellan scopes
- Eloquent traits for UUIDs, access scopes, cascade deletes, pruning, and model state helpers
- HTML sanitizing and trait inspection helpers
- String and currency lookup utilities
- A few console generators and maintenance commands

The package is intentionally lightweight. Most features are opt-in and can be used independently.

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

[](#requirements)

- PHP `^8.3`
- `illuminate/support` `^9.0|^10.0|^11.0|^12.0`
- `mews/purifier` `^3.4`

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

[](#installation)

Install the package with Composer:

```
composer require damianulan/laravel-lucent
```

Laravel package discovery registers the service provider automatically.

If you want the package config, translations, and stubs in your application, publish them:

```
php artisan vendor:publish --tag=lucent
```

You can also publish individual groups:

```
php artisan vendor:publish --tag=lucent-config
php artisan vendor:publish --tag=lucent-langs
```

What The Package Includes
-------------------------

[](#what-the-package-includes)

### Services

[](#services)

`Lucent\Services\Service` is a base class for application services that:

- accepts named boot parameters
- runs `handle()` inside a database transaction
- supports optional authorization and validation
- collects runtime or validation errors
- exposes the original input and the returned result
- provides a small cache helper via `remember()`

Generate a service class:

```
php artisan make:service CreateOrUpdateCampaign
```

Example service:

```
