Installation

Requirements

  • PHP 7.1 or higher
  • json extension
  • Database engine: MySQL 5.7 or higher, MariaDB 10.2.7 or higher or PostgreSQL is required*.

* JSON field types are used, therefore make sure to use the right version of your DB engine.

With Composer

# Create a new project (optional):
composer create-project --prefer-dist laravel/laravel vaniloapp
cd vaniloapp

# Install the vanilo package:
composer require vanilo/framework 0.4

# Publish module loader config:
php artisan vendor:publish --provider="Konekt\Concord\ConcordServiceProvider" --tag=config

Edit config/concord.php and add this content:

<?php

return [
    'modules' => [
        Konekt\AppShell\Providers\ModuleServiceProvider::class => [
            'ui' => [
                'name' => 'Vanilo',
                'url' => '/admin/product'
            ]
        ],
        Vanilo\Framework\Providers\ModuleServiceProvider::class
    ]
];

The following Concord modules should be installed now:

php artisan concord:modules -a

+-----+------------------------+--------+---------+------------------+------------------+
| #   | Name                   | Kind   | Version | Id               | Namespace        |
+-----+------------------------+--------+---------+------------------+------------------+
| 1.  | Konekt Address Module  | Module | 0.9.7   | konekt.address   | Konekt\Address   |
| 2.  | Konekt Customer Module | Module | 0.9.6   | konekt.customer  | Konekt\Customer  |
| 3.  | Konekt User Module     | Module | 0.9.0   | konekt.user      | Konekt\User      |
| 4.  | Konekt Acl Module      | Module | 1.1.0   | konekt.acl       | Konekt\Acl       |
| 5.  | Konekt AppShell Box    | Box    | 1.2.0   | konekt.app_shell | Konekt\AppShell  |
| 6.  | Vanilo Category Module | Module | 0.4.0   | vanilo.category  | Vanilo\Category  |
| 7.  | Vanilo Product Module  | Module | 0.4.0   | vanilo.product   | Vanilo\Product   |
| 8.  | Vanilo Cart Module     | Module | 0.4.0   | vanilo.cart      | Vanilo\Cart      |
| 9.  | Vanilo Checkout Module | Module | 0.4.0   | vanilo.checkout  | Vanilo\Checkout  |
| 10. | Vanilo Order Module    | Module | 0.4.0   | vanilo.order     | Vanilo\Order     |
| 11. | Vanilo Framework       | Box    | 0.4.0   | vanilo.framework | Vanilo\Framework |
+-----+------------------------+--------+---------+------------------+------------------+

Configure .env, along with a database. (Also create the db if necessary)

Afterwards run the migrations:

php artisan migrate

Vanilo contains ~20 migrations out of the box

It's not mandatory but recommended to seed the countries table:

php artisan db:seed --class 'Konekt\Address\Seeds\Countries'

Laravel Auth Support

First, Run php artisan make:auth

Modify App\User so that it extends Vanilo's user model:

// app/User.php
namespace App;

// No need to use Laravel default traits and properties as
// they're already present in the base class exactly as
// they're defined in a default Laravel installation
class User extends \Konekt\AppShell\Models\User
{
}

And add this to you AppServiceProviders's boot method:

   $this->app->concord->registerModel(\Konekt\User\Contracts\User::class, \App\User::class);

Create An Initial Super User

Run command php artisan appshell:super.

This will ask several questions and create a proper superuser that you can start working with.

NOTE: Accept admin as role for the very first user, because that's the only existing role after installation.

Add Admin's CSS To Laravel Mix

In webpack.mix.js change:

mix.js('resources/js/app.js', 'public/js')
    // Add these 2 lines:   
   .js('vendor/konekt/appshell/src/resources/assets/js/appshell.standalone.js', 'public/js/appshell.js')
   .sass('vendor/konekt/appshell/src/resources/assets/sass/appshell.sass', 'public/css')
    // Keep this for the "rest" (usually public frontend)
   .sass('resources/sass/app.scss', 'public/css');

Now compile the assets with mix:

yarn install
yarn run dev

TIP: If you have no yarn on your system refer to the Install yarn page.

Go To Admin

After this you can start serving the site with

php artisan serve

Now navigate to http://127.0.0.1:8000/admin/customer. You'll be able to log in with the user just created on the console.

You may expect to have a store frontend here, but there's none out of the box, and this is intentional, so that you can build one exactly your way. To see an example storefront implementation for Vanilo go to the demo project