Messages

Messages

Messages (Contact us) with attachment.

Moamen Eltouny (Raggi) Karim Mohamed (Komtcho)
PHP Version : >= 7.2 Laravel Version : >= 6.0 License Support
Source Packagist Version Packagist Downloads

Install

Install the latest version using Composer

composer require pharaonic/laravel-messages
php artisan migrate

OptionalPublish the migrations.

php artisan vendor:publish --tag=laravel-messages
Usage

Sending a message.

use Pharaonic\Laravel\Messages\Message;

$message = Message::send($request);

// Request Content
// ===============
// 1. name              	[string] (Optional)
// 2. email             	[string] (Optional)
// 3. mobile_country_code	[string] (Optional)
// 4. mobile_number     	[string] (Optional)
// 5. subject           	[string] (Optional)
// 6. message           	[string]
// 7. attachment        	[file] (Optional)

Manipulating a message.

use Pharaonic\Laravel\Messages\Message;

$message = Message::find(1);

// If sender was an auth user.
$message->sender;

// Mark as read
$message->markAsRead();

// Attachment file
$message->attachment;

// Check if messaging allowed by minutes (10)
Message::messageable($request, 10);     // True || False
Directives

@messageable (int $minutes)

Check if messaging allowed by minutes in Blade.

10 Minutes.

@messageable(10)
    Yes
@else
    No
@endmessageable