PHP code example of ilbronza / temporarylinks

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

    

ilbronza / temporarylinks example snippets


use IlBronza\TemporaryLinks\Facades\TemporaryLinks;

$result = TemporaryLinks::create()
    ->name('Compilazione rapportino')
    ->route('operators.timesheet.edit', ['operator' => $operator->getKey()])
    ->for($operator)                 // subject morph, opzionale
    ->expiresInMinutes(1440)         // default da config
    ->maxVisits(3)                   // opzionale
    ->password('1234')               // opzionale
    ->consumeOnFirstSuccess()        // opzionale, link monouso
    ->save();

$result->getPublicUrl(); // UNICO momento in cui l'URL col token in chiaro è disponibile
$result->link;           // il model TemporaryLink

Route::get('timesheet/{operator}/edit', ...)
    ->middleware('temporarylink.verified')
    ->name('operators.timesheet.edit');
bash
composer update ilbronza/temporarylinks
php artisan migrate