Repository navigation
Installation
Install Laravel framework. The following command will install the latest version of Laravel with the project name LaravelDefault.
composer create-project laravel/laravel LaravelDefault
Download Zip from PHPStencilGit repo.
Create a folder called "Packages" inside of the root of the Laravel project.
Paste the folder from the Git repo (Step 1.2) inside the Packages folder.
Inside the root Laravel project, open the composer.json file. In that file, look for:
"autoload" : {
"psr-4": {
...
Inside of the psr-4 tag, load the following:
"EONConsulting\\PHPStencil\\": "Packages/PHPStencil/src"
Just as above, except in the components composer.json file:
"EONConsulting\\PHPStencil\\": "src/*"
Under the psr-4 but still inside of the autoload if the array files does not exist, create it like this:
"files": [
...
]
And enter into it:
"Packages/PHPStencil/src/Http/helpers.php"
And again, in the components composer.json file:
"src/Http/helpers.php"
Open up config/app.php. In the providers array, enter the following:
EONConsulting\PHPStencil\PHPStencilServiceProvider::class,
In the same file, in the aliases array, enter:
'PHPStencil' => \EONConsulting\PHPStencil\src\Facades\PHPStencil::class,
To be able to use the tsugi, the APP_URL in your env file needs to be correct. So change it to the URL you are using for your testing environment.
In the command line / terminal, enter the following command in the root of the Laravel project:
composer dump-autoload -o
We have included a dummy_table in the database for testing purposes. To have access to the migrations, you will need to perform the following commands:
php artisan vendor:publish
php artisan migrate
Let's see this in action. Go to routes/web.php and where it says return view('welcome'); replace that with
echo PHPStencil::output();
// or
echo phpstencil()->output(); // if you did step 2.4
To test this out, go to the URL for this Laravel site.
You should now see the result "Hello World" being printed out to the screen.