PHP code example of alcaitiff / laravel-urlencode

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

    

alcaitiff / laravel-urlencode example snippets


  'providers' => [
    ...
    Alcaitiff\LaravelUrlEncode\RouteServiceProvider::class,
    ...
  ];

  //This is needed because Laravel DO NOT use his own service provider system
  //You can't change the app router and the kernel router through the dependency injection
  //The framework set a router at the very beginning of the stack and do not allow changes
  //We can only hope in future implementations actually using the injection system allowing that
  public function setRouter(Router $router) {
    $this->router = $router;
    return $this;
  }

  //https://stage.test.com/part/Cisco%20Systems%2C%20Inc/CISCO2851-SRST%2FK9
    Route::any('/part/{mfg}/{part}',
        array(
            'uses' =>'Vendorname\Package\Controllers\Hardware\PartController@part',
            'as' => 'part_page'
        )
    );