PHP code example of ebbbang / laravel-mailroom

1. Go to this page and download the library: Download ebbbang/laravel-mailroom 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/ */

    

ebbbang / laravel-mailroom example snippets


Gate::define('viewMailroom', fn (?User $user) => $user?->isAdmin());

Mailroom::auth(fn (Request $request) => $request->ip() === '10.0.0.1');

'middleware' => ['web', 'auth', Authorize::class],

'middleware' => ['web', 'auth', Authorize::class],

Gate::define('viewMailroom', fn (?User $user) => $user?->isQaTeam());

use Ebbbang\Mailroom\Events\MessageStored;

Event::listen(function (MessageStored $event) {
    $event->message;      // the stored MailroomMessage
    $event->sentMessage;  // Symfony's SentMessage
});
bash
php artisan vendor:publish --tag=mailroom-config   # config/mailroom.php
php artisan vendor:publish --tag=mailroom-views    # resources/views/vendor/mailroom
bash
php artisan mailroom:prune              # uses prune.retention_days (default 7)
php artisan mailroom:prune --days=30
php artisan mailroom:prune --hours=6
php artisan mailroom:prune --pretend
php artisan mailroom:clear              # everything, including stored files
bash
php artisan model:prune --model="Ebbbang\Mailroom\Models\MailroomMessage"