PHP code example of reliqarts / mardin

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

    

reliqarts / mardin example snippets


ReliQArts\Mardin\MardinServiceProvider::class,

    // ...

    @

    // ...
    use ReliQArts\Mardin\Traits\Messagable;
    use ReliQArts\Mardin\Contracts\User as MardinUserContract;

    class User extends Authenticatable implements MardinUserContract {
        use Messagable;

        // ...
    }
    

    use ReliQArts\Mardin\Models\Message as MardinMessage;

    class Message extends MardinMessage
    {
        // ...
    }
    

use App\Message; // a custom message model that extends ReliQArts\Mardin\Models\Message
use ReliQArts\Mardin\Policies\MessagePolicy;

/**
 * The policy mappings for the application.
 *
 * @var array
 */
protected $policies = [
    // ...
    Message::class => MessagePolicy::class,
];

{!! Form::open(['route' => 'create-message']) !!}
{!! Form::hidden('subject', "New Message") !!}
{!! Form::hidden('recipients[]', $user->id) !!}
<button class="btn new-message flat" title="Send a message to {{$user->name}}.">
    <span class="icon icon-email icon-lg"></span>
    <span>Send Message</span>
</button>
{!! Form::close() !!}

php artisan vendor:publish --provider="ReliQArts\Mardin\MardinServiceProvider"

php artisan vendor:publish --provider="ReliQArts\Mardin\MardinServiceProvider" --tag="config"

php artisan migrate