PHP code example of brayniverse / laravel-route-macros

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

    

brayniverse / laravel-route-macros example snippets


Brayniverse\RouteMacros\ServiceProvider::class

public function contact()
{
  return view('contact');
}

// or

Route::get('/contact', function () {
  return view('contact');
});

Route::view('/contact', 'contact');

Route::get('/contact_us', function () {
  return redirect('/contact');
});

Route::redirect('/contact_us', '/contact');

Route::redirect('/contact_us', '/contact', 302);