Laravel Use


Example

Now you can use the function document() everywhere in your code, for example in blade templates. This example only returns the same string it receives as an argument

<?php
Route::get('document/{text}', function($text) { 
    return document($text);
});

Now go to /document/foo in your browser (use php artisan serve or valet), which will return foo.