PHP code example of taksu-tech / laravel-restful

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

    

taksu-tech / laravel-restful example snippets


class Admin extends Model
{
    use ModelCommonTrait;
    ...
}


namespace App\Http\Controllers;

use App\Models\Admin;
use Taksu\Restful\Controllers\CrudController;

class AdminController extends CrudController
{
    public function __construct()
    {
        parent::__construct(Admin::class);
    }
}

use Taksu\Tenant\TenantAware;

class Admin extends Model
{
    use TenantAware;
    ...
}

use Taksu\RunningNumber\HasRunningNumber;

class Invoice extends Model
{
    use HasRunningNumber;

    protected $runningNumberColumn = 'number'; // default: 'number'
    protected $runningNumberPrefix = 'INV-';   // default: ''
    protected $runningNumberPadding = 6;       // default: 6
}

public function boot()
{
    if ($this->app->runningInConsole()) {
        $this->commands([
            Taksu\Console\Commands\MakeCrudController::class,
        ]);
    }
}

php artisan vendor:publish --tag=restful-migrations
php artisan migrate