PHP code example of nemesis / laravel-rest

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

    

nemesis / laravel-rest example snippets


    class SomeController
    {
        use IndexAction, ShowAction, StoreAction, UpdateAction, DestroyAction;
    
        protected $modelClass = SomeModel::class;    
    }

    public function baseQueryFilter($query)
    {
        return $query->where('owner', Auth::user()->id);
    }