Download the PHP package abd-wazzan/laravel-api-boilerplate without Composer

On this page you can find all versions of the php package abd-wazzan/laravel-api-boilerplate. 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 laravel-api-boilerplate

Laravel API Boilerplate

A Laravel project with a Domain-Driven Design (DDD) structure, basic configuration, and commonly used packages pre-installed and configured, to help you start building your next big application.

Requirements

Installation

Install dependencies

Setup .env file

Generate the application key

Run Locally

Installed Packages

General:

Development:

Features

DDD

Software development approach that tries to bring the business language and the source code as close as possible.

This structure is inspired by LARAVEL BEYOND CRUD.

Files Structure

Domain Layer Example:

src/Domain/Invoices/
├── Actions
├── QueryBuilders
├── Collections
├── Data
├── Events
├── Exceptions
├── Listeners
├── Models
├── Rules
└── States
src/Domain/Products/
├── Actions
└── .....

Application Layer Example:

The REST API application:
src/App/Api/
├── Products
    ├── Controllers
    ├── Middlewares
    ├── Requests
    ├── Queries
    ├── Filters
    └── Resources

The Console application
src/App/Console/
└── Commands

The admin HTTP application:
src/App/Admin/
├── Products
    ├── Controllers
    ├── Middlewares
    ├── Requests
    ├── Resources
    ├── Queries
    ├── Filters
    └── ViewModels

Dependency Illustration

Resources

API Response Helper

A simple trait allowing consistent API responses throughout your Laravel application.

Available methods:

Method Status
okResponse() 200
createdResponse() 201
failedResponse() 400
unauthorizedResponse() 401
forbiddenResponse() 403
notFoundResponse() 404
unprocessableResponse() 422
serverErrorResponse() 500

Usages Example:

Scribe Api Tags

Additional scribe tags that match the ApiResponseHelper responses.

Available Response tags:

Tag Status
@okResponse 200
@createdResponse 201
@failedResponse 400
@unauthorizedResponse 401
@forbiddenResponse 403
@notFoundResponse 404
@unprocessableResponse 422
@serverErrorResponse 500

Other Available tag:

Tag Description
@usesPagination will add page[number] and page[size] to the query parameters

Usages Example:

Global Helper

Simple php file that contains you global functions, which you can find it in ./src/shared/Helpers/global.php.

Migration Structure

In order to group your migration files by their domains, you can create additional migration directories and load them in the AppServiceProvider using loadMigrationsFrom function:

Polymorphic Mapping

Please read this article first to identify the problem.

In order to achieve the morph mapping, we created the MorphEnum that will contain each model morph key and then use it in Relation::morphMap function as shown in the example:

Database Seeders

We generally have two types of seeded data:

In order to prevent the fake data from being seeded in the production environment, we created a new seeder class called TestingSeeder.php which will contain all the fake data seeders and will only run in a non-production environment. The normal seeders will stay in DatabaseSeeder.php.

Shared Directory

The src/shared/ directory is used for helper, traits, enums .... that are going to be used by the application and the domain.

Feedback

I will be happy to hear your feedback! If you have any recommendation or suggestion, please send an e-mail to Mail.


All versions of laravel-api-boilerplate with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.5
laravel/framework Version ^10.4
laravel/passport Version ^11.8
laravel/tinker Version ^2.8
lorisleiva/laravel-actions Version ^2.5
spatie/laravel-data Version ^3.2
spatie/laravel-query-builder Version ^5.2
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 abd-wazzan/laravel-api-boilerplate contains the following files

Loading the files please wait ....