PHP code example of arnaldo-tomo / rotabonita

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

    

arnaldo-tomo / rotabonita example snippets


// Transparently intercepts Laravel's UrlGenerator
route('posts.show', $post); // → /posts/BYPWtH2qYos  (not /posts/1)

// Transparently intercepts RouteMatched Event before Controller receives it
// Reverts: BYPWtH2qYos → 1
GET /posts/BYPWtH2qYos → Resolves exactly as if the user accessed /posts/1

public function getPublicIdAttribute()
{
    return app(\Rotabonita\TokenGenerator::class)->encode($this);
}
// And add to your model: protected $appends = ['public_id'];

route('posts.show', $post); // Substitui a URL Generator Core silenciosamente (exibe BYPWtH2qYos)