Download the PHP package wendelladriel/larapi without Composer

On this page you can find all versions of the php package wendelladriel/larapi. 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 larapi

LARAPI

Opinionated API Skeleton created with Laravel

Configuring the project

This will:

Update your .env file as needed;

Run the migrations and the seeders:

Configure your local Virtual Host. After that visit the host URL and you will see a JSON response like below:

App Architecture

Inside the app folder will live only other folders, no files are allowed in the root. The basic architecture is composed by four main folders:

Core: The basic architecture files only are placed here:

Models: All the application Model classes are placed here, but no classes are allowed in the root of the directory. All models should be put into a namespace depending on its purpose, besides that there are two other folders:

Repositories: All the application Repository classes are placed here, but no classes are allowed in the root of the directory. All repositories should be put into a namespace depending on its purpose, besides that, there is a Traits folder for repository specific Traits. If you create a Repository for a specific Model class, use the same namespace you gave to the Model class, per example the Models\Auth\User repository MUST be Repositories\Auth\UserRepository. ALWAYS put the suffix Repository. All repositories MUST extend LarAPI\Core\Repositories\BaseRepository

Modules: All modules of the application are placed here, per example Auth Module. No classes are allowed in the root of the directory.

Common Module: This is a Module Folder (all module folders MUST HAVE the same folder and file structure). This module was created to have ONLY common and general purpose classes:

When you create a new Module in the app/Modules folder, add the module name to the config/modules.php file. This configuration file is also used to enable and disable modules in your API. The modules listed there will be the enabled ones.

Creating Scheduled Commands

All commands that will be scheduled on Console/Kernel MUST extends from LarAPI\Core\Console\ApiTaskCommand;

When scheduling the commands, all commands MUST be scheduled with the ->runInBackground(); method;

Features

API Documentation

LarAPI provides API documentation for your API using Swagger. You can check the API docs accessing: HOST_URL/swagger.

Auth

LarAPI provides you JWT Authentication, User Settings and User Roles out-of-the-box. You can check the default authentication endpoints on the Swagger Docs of the API.

Controllers

The LarAPI\Core\Http\BaseController class provides three helper methods for returning data from the API:

DTOs

LarAPI provides you two generic DTOs classes that can be useful for requests of datatables.Check out LarAPI\Modules\Common\Support\DTOs\CommonTableDTO and LarAPI\Modules\Common\Support\DTOs\DateRangeDTO

Exceptions

LarAPI provides a configured Exception Handler that will return only JSON responses and also a base interface for you to identify your custom exceptions that will be handled by the custom exception handler provided. It also provides a custom exception example.

Formatter

The LarAPI\Modules\Common\Support\Formatter class provides a lot of functions to format data and helper constants to use within your code.

Git Hooks

The project has some Git Hooks to update the API documentation using Swagger, to lint the PHP code using PHP-CS-FIXER and to run the tests using PHPUnit.

Health-Check Route

LarAPI provides a health-check route if you need to check if your API is up.

Module Management

You can use the following command to create a new module in your API:

Using the config/modules.php file you can enable and disable modules of your API.

Requests

LarAPI provides you two generic Request classes that can be useful for requests of datatables. Check out LarAPI\Modules\Common\Requests\CommonTableRequest and LarAPI\Modules\Common\Requests\DateRangeRequest

Repositories

The LarAPI\Core\Repositories\BaseRepository class offers a lot of generic purposes util functions, so you don't need to waste time creating functions for simple queries:

Scheduled Commands Manager

LarAPI provides you a custom manager for scheduled commands that will help you to prevent overlapping runs and also will make it easier to debug your scheduled commands. Check out the classes: LarAPI\Core\Console\ApiTaskCommand, LarAPI\Models\Common\ApiTask and LarAPI\Repositories\Common\ApiTaskRepository.

Slack Integration

The LarAPI\Modules\Common\Services\SlackClient class provides you a simple way to send notifications to Slack. To enable this integration you need to provide the SLACK_NOTIFICATIONS_WEBHOOK ENV variable.

Credits

And a special thanks to Caneco for the logo ✨


All versions of larapi with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
ext-curl Version *
ext-json Version *
fideloper/proxy Version ^4.2
fruitcake/laravel-cors Version ^1.0
guzzlehttp/guzzle Version ^7.0.1
laravel/framework Version ^8.0
laravel/tinker Version ^2.0
predis/predis Version ^1.1
tymon/jwt-auth Version ^1.0
zircote/swagger-php Version ^3.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 wendelladriel/larapi contains the following files

Loading the files please wait ....