PHP code example of iceylan / restorm
1. Go to this page and download the library: Download iceylan/restorm 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/ */
iceylan / restorm example snippets
use App\Models\Post;
use Iceylan\Restorm\Restorm;
Route::get( 'v1.0/posts', function( Restorm $restorm )
{
return $restorm
->apply( Post::class )
->get();
});
use App\Models\Post;
use Iceylan\Restorm\Restorm;
Route::get( 'v1.0/posts/{post}', function( Restorm $restorm, Post $post )
{
return $restorm
->apply( $post )
->get();
});