PHP code example of neon / site

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

    

neon / site example snippets


use Neon\Site\Facades\Site;


Site::patterns();

use Neon\Site\Facades\Site;
use Neon\Site\Http\Middleware\SiteMiddleware;

Route::group([
    'domain'      => Site::domain('domain_slug'),
    'middleware'  => SiteMiddleware::class
  ], function () {

  Route::group([
    'middleware'  => [SiteMiddleware::class]
  ], function () {

    Route::get('/', function() {
      echo 'Hello '.app('site')->current()->locale.' /// DOMAIN';
    });
  });
});

    'prefix'      => 'en',

use Neon\Site\Facades\Site;
use Neon\Site\Http\Middleware\SiteMiddleware;

Route::group([
    'prefix'      => Site::prefix('prefix_slug'),
    'middleware'  => SiteMiddleware::class
  ], function () {
  ...
});



namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Neon\Attributable\Models\Traits\Attributable; //- You cab check this too...
use Neon\Models\Traits\Uuid;
use Neon\Site\Models\Traits\SiteDependencies;

class AwesomeModel extends Model
{
    use Attributable;
    use Uuid;
    use SiteDependencies;

    ...

}
bash
php artisan vendor:publish --provider=\"Neon\\Site\\NeonSiteServiceProvider\"