Headless CMS and API generator for Laravel projects.
Add these lines to your composer.json
file
{
"require": {
"jestrux/pier": "dev-master"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/jestrux/pier-package.git"
}
]
}
And then in the terminal, run the following command.
composer update
Now that we have our package installed, we need to migrate the database to add the necessary tables for Press. In the command line, run the following command.
php artisan migrate
php artisan vendor:publish --tag=pier-assets
You will now find the pier asset files under /public/pier
Add the following to your .env file and set the correct values...
PIER_FORM_REDIRECT_URL=
PIER_UNSPLASH_CLIENT_ID=
PIER_S3_BUCKET=
PIER_S3_REGION=
PIER_S3_ACCESS_KEY_ID=
PIER_S3_SECRET_ACCESS_KEY=
If you plan to upload files to your asset files instead of S3, there are two ways:
Add the following field to .env
which points to a post
url.
PIER_UPLOAD_URL=/pier-upload-file
The controller should return a response similar to the one below.
return response()->json([
"success" => true,
"path" => asset(str_replace("public", "storage", $path))
]);
Add the following field to .env
PIER_UPLOAD_DIR=pierFiles
Add port number to APP_URL in .env
includes port number if you're using localhost
--APP_URL=http://localhost
++APP_URL=http://localhost:8000
Also update the local disk under config.filesystems.php
as follows:
--'root' => storage_path('app'),
++'root' => public_path('img/uploads'),
++'url' => env('APP_URL') . '/img/uploads',
To change the theme color, app name and app logo in the CMS, update the following:
APP_NAME="My App"
APP_COLOR="#1F571A"
APP_LOGO=img/logo.png
Note: Similar to the sample above, the APP_LOGO
should be a path in your public folder, Pier will automatically wrap it with asset()
Before you can customize pier configs, you need to first publish the package's config file that includes some defaults for us. To publish that, run the following command.
php artisan vendor:publish --tag=pier-config
You will now find the config file located in /config/pier.php
Set the value of the prefix field under config/pier.php
to your liking
Set the value of the middleware field under config/pier.php
to your liking
The MIT License (MIT). Please see License File for more information.