Download the PHP package caffeinated/path without Composer
On this page you can find all versions of the php package caffeinated/path. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download caffeinated/path
More information about caffeinated/path
Files in caffeinated/path
Informations about the package path
This package has been abandoned and is no longer maintained.
Caffeinated Path
Note: This was originally part of the Caffeinated/Path package. I've extracted it out into it's own package.
Caffeinated Path allows the means to easily customize the default structure of your Laravel 5 application. This means you can take the default Laravel framework structure:
And configure it into something like:
The package follows the FIG standards PSR-1, PSR-2, and PSR-4 to ensure a high level of interoperability between shared PHP code.
Quick Installation
Begin by installing the package through Composer.
Once this operation is complete, simply add the service provider class to your project's config/app.php
file:
Service Provider
Instantiate Caffeinated Path Application
First off, you'll need to use the Caffeinated Path Application instance in place of Laravel's Illuminate Foundation Application. Simply replace it within the bootstrap/app.php
file like so:
The Caffeinated Path Application extends the Illuminate Foundation Application and adds the ability to customize the directories via the provided path
config file.
Now you may configure any of the base paths as you like! Though do note, that some paths require a little more setup than others:
- Setting a Custom Config Path
- Changing The Bootstrap Path
Read on to find out how to configure these paths, or use the above links to jump directly to any section.
Setting a Custom Config Path
If you'd like to move your config
directory, provide the path as the second parameter when creating a new instance of the Caffeinated Path Application:
Changing The Bootstrap Path
Caffeinated Path does not provide the means to change your bootstrap
directory path, because it's a simply edit you need to make within the three following files (don't worry, it's nothing complicated):
public/index.php
bootstrap/app.php
bootstrap/autoload.php
Step 1: Updating public/index.php
First off, you'll be wanting to change the following two require
paths within your public/index.php
file:
Step 2: Updating bootstrap/app.php
Secondly, open your bootstrap/app.php
file and update the relevant path to your application base:
Step 3: Updating bootstrap/autoload.php
Lastly, open your bootstrap/autoload.php
file and update both the Composer autoload and compiled class paths:
That should be it! Simply fire up your app to verify.