eyepax-prasanna/php7-starter-kit

There is no license information available for the latest version (dev-master) of this package.

This is a starter kit to begin a application with PHP 7.

dev-master 2017-08-11 11:43 UTC

This package is auto-updated.

Last update: 2024-04-07 17:35:37 UTC


README

PHP 7 Starter kit

Eyepax IT Consulting (Pvt) Ltd

About PHP 7 Starter kit

This is a starter kit for those who are looking to build an application with PHP 7. This is an enhanced build of PHP7 Boilerplate. The additions are

Quick start

Install with composer.

composer create-project eyepax-prasanna/php7-starter-kit <project-path> -s dev

Using the PHP 7 Starter kit

This starter kit is designed to use with ease. It has well defined folder structure.

  • config folder has configuration files, which you can add as many files as you want. You can access the config values from anywhere, by calling the file name and keys with dot notation. Eg: config('general.pagination_per_page')
  • Can define environment variables in .env file and can call them using env() function. A sample env file is given (.env.example).
  • src/app folder has the controllers, libraries, models and repositories.
  • src/resources folder can have the template view files.
  • src/routes.php can have the routes for the application. For more details on the routing, please check the PHRoute documentation.
  • All the Input values can be retrieved using Laravel style. To get all input values, use Input::all(), and to get a specific value use Input::get('item').
  • phpcs is configured. So, can make the code comply with PSR standards.
  • url() function will give you the URL of the application. You can append a part of URL by passing it as an argument. Eg: url('users') will give you http://{url-of-app}/users.
  • storage_path(), function will give you the relative path for the storage folder. So you can save the uploaded files there.
  • public_path(), function will give you the relative path for the web folder.
  • dd('contents') will print and die (A Laravel style function).