Download the PHP package ragboyjr/laravel-api-skeleton without Composer

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

Laravel API Skeleton

Install via:

Once installed, you'll want to run the following:

Once completed, start docker via docker-compose up and run ./artisan doctrine:migrations:diff to generate the initial migration.

Development Setup

  1. copy over all the example files: make ignored-files
  2. Start the docker containers: docker-compose up
  3. Exec into the {project} container via docker exec -it {project} bash
  4. Run make setup to initialize the repo. This will initialize all aspects of the repo, you can see what this script does by viewing the Makefile.

At the end of make setup, it should have generated a long access token, you'll need to copy that into the .env and set the INTEGRATION_API_TOKEN value.

To verify that you've been setup correctly, you need to run make test and then make refresh-db test-integration. These will run the entire test suite. If any fail, then there was an issue with setup that will need to be resolved.

Development

This app is built with Laravel and Doctrine.

Migrations

From inside of the {project} container, run ./artisan doctrine:migrations:migrate to load the database. You'll need to run this every time there is a new migration. You should be in a habit to just run migrations when you pull the latest code from stg.

Generating Migrations

The best way to manage migrations is by configuring the metadata yaml files first, then simply running ./artisan doctrine:migrations:diff. This will create a migration file that will take the diff of your current local db to the migration mapping files. Keep this in mind because if you forgot to run ./artisan doctrine:migrations:migrate to bring your local db up to the latest, running the migrations-diff command could re-apply some database changes which will break the migrations.

Testing

Unit Testing

Integration Testing

Make sure all tests pass before pushing up.

Workflow

The easiest way to develop with phpunit and testing is to create specific tests for whatever you are doing, and then run them individually with phpunit.

For example, if I'm working on the tests/Integration/RepApiTest testApproveRepNotFound method, I'll run inside of the docker container the following command to test only that method:

Playground

playground.php is a file that allows you to quickly prototype/test code in the current app. It's just a simple console command, but the file is ignored, so that you don't have to worry about comitting those temp changes.

You can run the playground via: ./artisan playground.

Trouble Shooting

Here are some common errors you can get when developing and here's how to fix them.

Status 500 in Tests

When asserting a status code in an integration test, and you get a status 500, the easiest way to start debugging is to just check the storage/logs/laravel.log and find the exception that occurred.

Exception: Unresolvable dependency resolving [Parameter #0 [ $entityName ]] in class Doctrine\ORM\Mapping\ClassMetadataInfo

This can occur when you create a Repository class for an entity, and then type hint for the specific repository class but don't register the repository class in a service provider. To resolve this issue, you need to register the repository in the module's service provider like this:

The addEntityRepo expects the laravel app instance and the class name of the entity not the repository class.

You can see examples of register repositories in the service provider in the different modules in the app/Model folder.


All versions of laravel-api-skeleton with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
doctrine/dbal Version ^2.6
fideloper/proxy Version ^4.0
krak/doctrine-oauth2 Version ^0.1.1
krak/fn Version ^0.1.7
krak/marshal Version ^0.2.3
krak/validation Version ^0.3.9
laravel-doctrine/migrations Version ^1.1
laravel-doctrine/orm Version 1.4.*
laravel/framework Version 5.6.*
predis/predis Version ^1.1
symfony/psr-http-message-bridge Version ^1.0
zendframework/zend-diactoros Version ^1.7
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 ragboyjr/laravel-api-skeleton contains the following files

Loading the files please wait ...