PHP code example of rapidez / statamic-quote

1. Go to this page and download the library: Download rapidez/statamic-quote library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rapidez / statamic-quote example snippets


Eventy::addFilter('quote.data', function ($quoteData) {
    return [
        ...$quoteData,
        'products' => $quoteData['products']->map([...])
    ];
});

Eventy::addFilter('quote.data', function ($quoteData) {
    if ($quoteData['products']->contains(fn($item) => $item['product']->no_quote)) {
        // Don't send
        return null;
    }
    
    return $quoteData;
});

Eventy::addFilter('quote.mail', function ($mail) {
    return $mail->bcc('[email protected]');
});
sh
php artisan vendor:publish --tag=quote-content
php artisan vendor:publish --tag=quote-config