PHP code example of mikemclin / laravel-to-angular-constant

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

    

mikemclin / laravel-to-angular-constant example snippets


public function index()
{
    Angular::put([
        'foo' => 'bar',
        'age' => 29
    ]);

    return View::make('footer');
}


// config/app.php

'providers' => [
    '...',
    'MikeMcLin\Angular\AngularServiceProvider'
];



return [

    /*
    |--------------------------------------------------------------------------
    | View to Bind Angular Constant To
    |--------------------------------------------------------------------------
    |
    | Set this value to the name of the view (or partial) that
    | you want to prepend your Angular constant to.
    | This can be a single view, or an array of views.
    | Example: 'footer' or ['footer', 'bottom']
    |
    */
    'bind_ng_constant_to_this_view' => 'footer',

    /*
    |--------------------------------------------------------------------------
    | Angular Module
    |--------------------------------------------------------------------------
    |
    | Change this to the Angular module that you want to bind (output)
    | your Angular constant to. You will probably want to 
bash
php artisan vendor:publish