PHP code example of zealous-creations / tranquil-model-controller

1. Go to this page and download the library: Download zealous-creations/tranquil-model-controller 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/ */

    

zealous-creations / tranquil-model-controller example snippets


class CarController extends TranquilController {}

// routes/web.php

Route::resource('cars', CarController::class);

class Car extends TranquilModel {
    //...
}

class Car extends Model {
    use HasValidation;
    //...
}

// routes/web.php

Route::post('cars/list', [CarController::class, 'list'])->name('cars.list');

class CarController extends TranquilInertiaController {}

class User extends \Tranquil\Models\TranquilUser {
    
    public const roleOptions = [
		[
			'handle'      => 'super',
			'name'        => 'Super User',
			'description' => 'Has full access',
		],
		[
			'handle'      => 'leader',
			'name'        => 'Leader',
			'description' => 'Has administrator access',
		],
		[
			'handle'      => 'staff',
			'name'        => 'Staff',
			'description' => 'Has basic access',
		],
	];
	
	//...
}
shell
php artisan vendor:publish --tag=tranquil-model-migrations