Installation

Premise

Laraloop is built on Laravel, so as a rule of thumb — anywhere Laravel runs, Laraloop runs. Laraloop has a few server requirements. Not all servers are created equal and not all hosts play nice. Laravel is one of the simplest web applications to get up and running, but there are many different ways to run PHP apps. It's unlikely that everything in this doc will apply to your personal style. You can find additional information how to setup server on official Laravel documentation. If you are using a Mac, I suggest to check in Valet. While for remote server check into Forge + Digital Ocean. I do, and I love it. Anyway, here's what you're going to need. You will need to make sure your server meets the following requirements:

  • A web server: Apache, Nginx, or IIS
  • URL Rewriting enabled (mod_rewrite, try_files, etc)
  • PHP >= 7.4
  • BCMath PHP Extension
  • Ctype PHP Extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension
  • ZIP PHP Extension

The only thing that this doc doesn't cover is server installation, since there is many way to do this, and you can find already good tutorial online for doing this. You can (and probably should) run Laraloop locally while you develop your site. There are a number of solutions that give you all the tools you need without having to compile anything by hand.

This documentation assumes you are already familiar with Laravel. If you do not know anything about Laravel, consider familiarizing yourself with the general terminology and features of Laravel before continuing. Check official Laravel documentation is good starting point.

1.1. Quick package

$ cd path/to/your/webserver
$ git clone git@github.com:laraloop/dev.git laraloop
$ cd laraloop
$ composer install
$ mysql -uroot
$ create database laraloop;
$ cp .env.example .env

NOTE: If you see issue "PHP Fatal error: Allowed memory size of ... bytes exhausted" then check here for a solution https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors. For example use composer install like below:

COMPOSER_MEMORY_LIMIT=-1 composer install

Add database name, host, user and password.

$ php artisan laraloop:install

TIP: First time you run laraloop:install it will ask to create .env file if missing. So you can also run immediately the installation command after create database.

NOTE: The installation command will create two users, one admin and one super admin. The password and email for login will appear on screen. The password for both is Secret123! and email admin@example.com for admin and super-admin@example.com for super admin.

You can also create additional user via command line or edit an existing. Run below command and follow instruction on screen, it will be asked name, username, email, password and user role.

$ php artisan laraloop:create-user

And for update user with ID 1 run below command.

$ php artisan laraloop:update-user --id=1

The --id option is not mandatory, if you omitt it then will be asked. Run command followed with --help option to see command signature.

Get a coffee and enjoy in coding ;-)

1.2. Install in existing project

Steps

  • Create a packages folder in root of your Laravel installation and add laraloop packages inside.
  • Update composer.json file by adding below content:
 "repositories": [{
        "type": "path",
        "url": "packages/*/*/",
        "options": {
            "symlink": true
        }
    }],
    "require": {
        "laraloop/core": "@dev",
        "laraloop/admin": "@dev",
        "laraloop/api": "@dev",
        "laraloop/frontend": "@dev"
    },
    "require-dev": {
        "laraloop/tools": "@dev",
        "laraloop/playground": "@dev"
    },

NOTE If you don't need API, then you don't need to install package laraloop/api. You could also remove admin and frontend, and keep only API and Core, I don't think that you want to do that. Frontend has the authorizations (login, register, etc.) required to login also in admin.

  • Now you can run composer update and then php artisan laraloop:install like in quick installation package.

NOTE: If you are installing with Laravel 8, then be sure that your RouteServiceProvider.php has $namespace defined like:

protected $namespace = 'App\\Http\\Controllers';

In alternative, you can add in your route file for each generated resource like:

use App\Http\Controllers\MyResource;

Since Laravel 8 has change how routes are defined, for keep compatibility with Laravel 7, the code generator still use the way how Laravel 7 used to define routes.

1.3 Post installation

You can migrate any amount of users by running below command.

$ php artisan laraloop:seed-users

It will ask different options. First how max users to create, this is easy. Then how many users per day, all today or it will generate randomly a created date. This is useful to see statistics on admin dashboard which display total based on creation date. Last thing will ask if create all users with active status, or randomly create users with different status like unverified, banned or trashed.