PHP code example of neeraj / catalyst-starterkit-restapi

1. Go to this page and download the library: Download neeraj/catalyst-starterkit-restapi 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/ */

    

neeraj / catalyst-starterkit-restapi example snippets


// routes/api.php
Route::apiResource('products', ProductController::class);

$this->interface->index(Model $model, $paginated, $folder, $files, $where, $whereNot, $search, $active, $verify, $relation);

$this->interface->getById(Model $model, $id, $folder, $files, $where, $whereNot, $search, $active, $verify, $relation);

$this->interface->store(Model $model, $data, $request, $folder, $files, $modified_values, $hashing_values, $relation);

$this->interface->update(Model $model, $data, $id, $request, $folder, $files, $modified_values, $hashing_values, $where, $whereNot, $search, $active, $verify, $relation);

$this->interface->delete(Model $model, $folder, $id, $where, $whereNot, $search, $active, $verify, $relation);

$this->interface->verify(Model $model, $id);
$this->interface->unverify(Model $model, $id);
bash
php artisan jwt:secret
bash
php artisan migrate

app/
├── Http/
│   ├── Controllers/
│   │   └── ProductController.php
│   ├── Requests/
│   │   ├── StoreProductRequest.php
│   │   └── UpdateProductRequest.php
├── Models/
│   └── Product.php
├── Repositories/
│   ├── BaseRepository.php
│   └── CrudRepository.php