Download the PHP package zealous-creations/tranquil-model-controller without Composer

On this page you can find all versions of the php package zealous-creations/tranquil-model-controller. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tranquil-model-controller

Tranquil Models and Controllers

This package contains base Laravel Eloquent models and controllers that contain all the functionality you'll need for CRUD operations. Making Laravel development a more "Tranquil" experience.

Compatible with Laravel 10, 11, and 12

Install

Require it with composer

NOTE: If you have installed inertiajs/inertia-laravel lower than v0.6 or doctrine/dbal lower than v3.0 then you may need to remove them before requiring zealous-creations/tranquil-model-controller

Publish migrations

There are 2 migrations in this package for creating a users table and an attachments table

If you want to modify these migrations be for running them, then run this artisan command:

Usage

Tranquil Controller

The Tranquil Controller takes care of all the methods of a standard Laravel controller: index, create, show, edit, store, and destroy

For any of your model controllers all you have to do is extend TranquilController

Then all you need to do is add the resource routes for the model.

Now all of the endpoints for the resource routes will automatically work - without having to add any methods to your controller.

Show Endpoint Example

GET /cars/1

Update Endpoint Example

PATCH /cars/1 PAYLOAD {"year": 2024}

This will update year column of the cars record that has the id of 1 - As long as the year is included in the $fillable model parameter.

Or if you have the model extend TranquilModel

Store Endpoint Example

POST /cars PAYLOAD {"make": "Tesla", "model": "Model S", year": 2024}

This will create a new record in the cars table. You can have automatic input validation if the model extends TranquilModel or uses the HasValidation trait.

List Endpoint

There is also a list route endpoint you can add for fetching a list of records for the model

Example

POST /cars/list PAYLOAD {"where": {"make": "Buick"}}

Tranquil Inertia Controller

You can return Inertia responses for all the standard controller methods by extending the TranquilInertiaController

Now all of the endpoints will return an Inertia response to the corresponding component path.

User Model

This package also comes with a TranquilUser model that is for the authenticated user.

You can extend this model to modify it:


All versions of tranquil-model-controller with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version >=10.0 <13.0
inertiajs/inertia-laravel Version >=0.6 <3.0
laravel/sanctum Version >=3.0 <5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zealous-creations/tranquil-model-controller contains the following files

Loading the files please wait ....