PHPackages                             mimisk/laravel-quotes - 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. mimisk/laravel-quotes

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

mimisk/laravel-quotes
=====================

Simple quote utilities for Laravel applications.

v0.0.4(1mo ago)00MITPHPPHP ^8.4CI passing

Since Apr 25Pushed 1mo agoCompare

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

READMEChangelog (2)Dependencies (5)Versions (5)Used By (0)

LaravelQuotes
=============

[](#laravelquotes)

[![Tests](https://camo.githubusercontent.com/6ee04ae221f097ac894c4eae716ad46dfc72c54fcdee04090f7d273afc91a6c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4d696d69734b31332f6c61726176656c2d71756f7465732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/MimisK13/laravel-quotes/actions/workflows/tests.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/74d20e7bf6b5262f2b6211302c69a7d823dc678b9d1f14eb49b4ef64f524c099/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696d69736b2f6c61726176656c2d71756f7465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mimisk/laravel-quotes)[![Total Downloads](https://camo.githubusercontent.com/77125174e2368842ecfc63096c53271e3503bfb23ab1b187f730a98fdcd94a09/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696d69736b2f6c61726176656c2d71756f7465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mimisk/laravel-quotes)[![codecov](https://camo.githubusercontent.com/47b8d44814afbe2a9f7f9be0441b97f29596448a9e429c425e0169692d18cdf3/68747470733a2f2f636f6465636f762e696f2f67682f4d696d69734b31332f6c61726176656c2d71756f7465732f67726170682f62616467652e7376673f746f6b656e3d4a4f364a39314f443643)](https://codecov.io/gh/MimisK13/laravel-quotes)

A lightweight Laravel package that provides quote helpers with config-driven defaults.

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

[](#installation)

Via Composer

```
composer require mimisk/laravel-quotes
```

Usage
-----

[](#usage)

Publish config (optional):

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

Create a quote (owner can be any morphable Eloquent model, e.g. `Customer`):

```
use Mimisk\LaravelQuotes\Actions\CreateQuoteAction;
use Mimisk\LaravelQuotes\DTOs\QuoteData;

$quote = app(CreateQuoteAction::class)->handle(QuoteData::fromArray([
    'owner' => $customer,
    'title' => 'Customer Products Quote',
    'currency' => 'EUR',
    'discount_type' => 'fixed', // fixed | percentage
    'discount_value' => 50,
    'items' => [
        [
            'name' => 'Product A',
            'quantity' => 2,
            'unit_price' => 120,
            'tax_rate' => 24,
        ],
        [
            'name' => 'Product B',
            'quantity' => 1,
            'unit_price' => 85,
            'tax_rate' => 24,
        ],
    ],
]));
```

Update a draft quote:

```
use Mimisk\LaravelQuotes\Actions\UpdateQuoteAction;
use Mimisk\LaravelQuotes\DTOs\QuoteData;

app(UpdateQuoteAction::class)->handle(
    $quote,
    QuoteData::fromArray([
        'owner' => $customer,
        'title' => 'Updated Customer Quote',
        'items' => [
            [
                'name' => 'Product A (Updated)',
                'quantity' => 3,
                'unit_price' => 110,
                'tax_rate' => 24,
            ],
        ],
    ])
);
```

Status transitions:

```
use Mimisk\LaravelQuotes\Actions\AcceptQuoteAction;
use Mimisk\LaravelQuotes\Actions\ExpireQuoteAction;
use Mimisk\LaravelQuotes\Actions\RejectQuoteAction;
use Mimisk\LaravelQuotes\Actions\SendQuoteAction;

app(SendQuoteAction::class)->handle($quote);    // draft -> sent
app(AcceptQuoteAction::class)->handle($quote);  // sent -> accepted
app(RejectQuoteAction::class)->handle($quote);  // sent -> rejected
app(ExpireQuoteAction::class)->handle($quote);  // sent -> expired
```

Delete a quote:

```
use Mimisk\LaravelQuotes\Actions\DeleteQuoteAction;

app(DeleteQuoteAction::class)->handle($quote); // only draft or rejected
```

Error Handling
--------------

[](#error-handling)

Actions may throw domain exceptions when an invalid operation is attempted.

For example, trying to accept a quote that is not in the `sent` state will throw an `InvalidQuoteTransition` exception.

You can handle these exceptions using a simple try/catch:

```
use Mimisk\LaravelQuotes\Exceptions\InvalidQuoteTransition;

try {
    app(AcceptQuoteAction::class)->handle($quote);
} catch (InvalidQuoteTransition $exception) {
    return back()->with('error', $exception->getMessage());
}
```

Alternatively, you may handle these exceptions globally using Laravel's exception handler:

```
// bootstrap/app.php

use Mimisk\LaravelQuotes\Exceptions\InvalidQuoteTransition;

->withExceptions(function ($exceptions) {
    $exceptions->render(function (InvalidQuoteTransition $exception) {
        return back()->with('error', $exception->getMessage());
    });
})
```

### Quote Expiration Automation

[](#quote-expiration-automation)

The package provides an Artisan command to automatically expire quotes based on the `valid_until` field.

Run the command manually:

```
php artisan quotes:expire
```

The command will find all `sent` quotes where `valid_until` has passed and mark them as expired.

You may schedule it in your application using Laravel's scheduler:

```
use Illuminate\Support\Facades\Schedule;

Schedule::command('quotes:expire')->daily();
```

You can adjust the frequency as needed:

```
Schedule::command('quotes:expire')->hourly();
```

Events
------

[](#events)

The package dispatches the following events:

- `QuoteCreated`
- `QuoteUpdated`
- `QuoteSent`
- `QuoteAccepted`
- `QuoteRejected`
- `QuoteExpired`

Change log
----------

[](#change-log)

Please see the [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email `mimisk88@gmail.com` instead of using the issue tracker.

Credits
-------

[](#credits)

- [Mimis K](https://github.com/mimisk)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [LICENSE file](LICENSE) for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance91

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

44d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9fb24d3d1caf4440de446b880db80aaf5eb5b080dff6b6997a8e2783910f1af?d=identicon)[MimisK](/maintainers/MimisK)

---

Top Contributors

[![MimisK13](https://avatars.githubusercontent.com/u/10620005?v=4)](https://github.com/MimisK13 "MimisK13 (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

laravelquotesmimisk

###  Code Quality

TestsPest

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/mimisk-laravel-quotes/health.svg)

```
[![Health](https://phpackages.com/badges/mimisk-laravel-quotes/health.svg)](https://phpackages.com/packages/mimisk-laravel-quotes)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k9.6k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90128.1k](/packages/emargareten-inertia-modal)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3614.9k](/packages/linkxtr-laravel-qrcode)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
