Ploi Core
Ploi Core

Installation

Once you have subscribed to Ploi Core you may either clone or download the software from our Github repository.

Run this command on your server to clone the software:

$ git clone git@github.com:ploi/ploi-core.git

Or you can download it straight from the repository (This repository is not available if you don't have access to it, that's the reason it could return a 404)

https://github.com/ploi/ploi-core

Make sure to point the public folder properly to /public from where you cloned or unzipped the software. Next you can run composer install to install all the dependencies it needs:

$ composer install --no-interaction --prefer-dist --no-dev --optimize-autoloader

While that is running, create a database for your software to work with. After composer install is done, run the following commands to actually start setting up Ploi Core:

$ php artisan core:install
$ php artisan icons:cache

Keep the following data close because installation will be asking for this:

  • Ploi Core API key
  • Ploi API key
  • Database credentials

Running the queue worker

In order for the background tasks to run such as retrieving statuses, you'll need to start up a queue worker.

First of all start by making sure the QUEUE_CONNECTION in your .env file is set to either: redis, database, beanstalkd or sqs. The easiest choice is either redis or database which is most common.

.env file

QUEUE_CONNECTION=redis

We recommend to use redis (like above) and use Laravel Horizon, so you don't have to manually start queue workers. Laravel horizon is installed by default and can be used right away. (Be aware, Laravel Horizon only supports redis, so make sure you have a redis server installed)

Method 1 Laravel Horizon (recommended):

Create a supervisor daemon that runs Laravel Horizon with the following configuration:

[program:worker-horizon]
command=php /home/ploi/my-app.com/artisan horizon
process_name=%(program_name)s_%(process_num)02d
autostart=true
autorestart=true
user=ploi
redirect_stderr=true
numprocs=1
stdout_logfile=/home/ploi/.ploi/worker-horizon.log
Running Laravel Horizon is fairly easy with Ploi: https://ploi.io/documentation/laravel/how-do-i-run-laravel-horizon

Method 2 default Laravel queue's

Queues to start:

  • default

Example how to start the queue:

$ php artisan queue:work redis --timeout=60 --sleep=5 --tries=3 --queue=default

Cron

Ploi Core comes with automatic rotation to keep your database clean from any old entries and logs.

To run this, create a cronjob each minute:

$ php /home/ploi/domain.com/artisan schedule:run