Fork me on GitHub

Mesour Laravel Bridges

Laravel bridges for session and application

Packagist

  • None
  • None

Installation

Suggests

  • None

Sandbox for Laravel Project with DataGrid

composer create-project mesour/laravel-sandbox -s beta

Register ApplicationServiceProvider in app.php

See: Mesour\Bridges\Laravel\ApplicationServiceProvider

return [

    // ... other settings

    'providers' => [

        // ... other providers

        /*
         * Mesour application service provider
         */
        Mesour\Bridges\Laravel\ApplicationServiceProvider::class,

    ],

];

Inject Mesour\Bridges\Laravel\ApplicationManager

and get Mesour\UI\Application

public function __construct(Mesour\Bridges\Laravel\ApplicationManager $applicationManager)
{
    /** @var Mesour\UI\Application $app */
    $app = $applicationManager->getApplication();

    // ... your logic
{

Configuration in mesour_app.php

return [

    /*
     * Name of application
     * used in link parameters and identifiers
     */

    'name' => 'mesourApp'

];

CSRF protection for POSTs

Insert this HTML to your .blade.php

<script>
    var mesour = !mesour ? {} : mesour;
    mesour.parameters = !mesour.parameters ? [] : mesour.parameters;
    mesour.parameters.push(["set", "_token", "{{ csrf_token() }}"]);
</script>