Download the PHP package mimisk/laravel-quotes without Composer
On this page you can find all versions of the php package mimisk/laravel-quotes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mimisk/laravel-quotes
More information about mimisk/laravel-quotes
Files in mimisk/laravel-quotes
Package laravel-quotes
Short Description Simple quote utilities for Laravel applications.
License MIT
Homepage https://github.com/MimisK13/laravel-quotes
Informations about the package laravel-quotes
LaravelQuotes
A lightweight Laravel package that provides quote helpers with config-driven defaults.
Installation
Via Composer
Usage
Publish config (optional):
Create a quote (owner can be any morphable Eloquent model, e.g. Customer):
Update a draft quote:
Status transitions:
Delete a quote:
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:
Alternatively, you may handle these exceptions globally using Laravel's exception handler:
Quote Expiration Automation
The package provides an Artisan command to automatically expire quotes based on the valid_until field.
Run the command manually:
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:
You can adjust the frequency as needed:
Events
The package dispatches the following events:
QuoteCreatedQuoteUpdatedQuoteSentQuoteAcceptedQuoteRejectedQuoteExpired
Change log
Please see the CHANGELOG for more information on what has changed recently.
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Mimis K
- All Contributors
License
MIT. Please see the LICENSE file for more information.