1. Go to this page and download the library: Download nathanburkett/ecosystem 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/ */
Route::group(['middleware' => 'ecosystem', 'ecosystem' => 'App\Library\Ecosystems\StandardEcosystem'], function () {
// NewStandardEcosystem would be used for the '/' route
Route::get('/', ['middleware' => 'ecosystem', 'ecosystem' => 'App\Library\Ecosystems\NewStandardEcosystem', 'uses' => 'IndexController@index']);
});
namespace App\Http\Controllers;
use Ecosystem;
// ...
class IndexController extends Controller
{
public function index() {
Ecosystem::addScriptToHead('blammo', ['src' => '/blammo.js']);
}
}
function addScriptToHead($name, $attr = array(), $before = null)