How to install as New Laravel Project

Mybizna is an open-source ERP (Enterprise Resource Planning) solution for Laravel. It is developed using Laravel which is a web application framework with expressive, elegant syntax.

Prerequisites

Before proceeding with the installation, make sure you have the following prerequisites:

  1. PHP (version 8.1 or higher)

  2. Composer (Dependency Manager for PHP)

  3. MySQL or any other compatible database server

Quick Installation

To Quickly install the system run the following command.

composer create-project mybizna/setup mybizna

Step By Step Installation

Step 1

Create a new Laravel project Open your terminal or command prompt and navigate to the directory where you want to create your Laravel ERP project. Run the following command to create a new Laravel project:

composer create-project laravel/laravel:^9.0 mybizna

Step 2

Navigate to the project directory Change into the project directory using the following command:

cd mybizna/

Step 3

Install the required package To install the Laravel ERP package, run the following command:

composer require mybizna/account

Step 4

Configure the database Open the .env file in the root directory of your project and modify the following lines to match your database credentials:

DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=[Your_DB_Name]
DB_USERNAME=[Your_DB_Username]
DB_PASSWORD=[Your_DB_Password]

CACHE_DRIVER=database
SESSION_DRIVER=database
SESSION_DOMAIN=
SANCTUM_STATEFUL_DOMAINS=

Step 5

Edit the User model Open the app/Models/User.php file and add the following lines inside the protected $fillable array:

'username',
'is_admin',
'phone',

Step 6

Add class and trait to the User model Add the following lines at the top of the app/Models/User.php file:

use Spatie\Permission\Traits\HasRoles;

Inside the User model class, add the following line:

use HasRoles;

Step 7

Publish the following;

php artisan cache:table
php artisan session:table
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
php artisan vendor:publish --provider="Mybizna\Assets\Providers\MybiznaAssetsProvider"
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
  • 1 is for generating the cache table used in managing system cache.

  • 2 is for generate the session table used for managing system session using database.

  • 3 is for publishing santrum migration files to be used to login to Mybizna ERP API.

  • 4 is for publishing assets and database migration for adding username, phone, and email to the users table in the database.

  • 5 is for publishing permissions configuration provided by the Spatie/Permission package.

Add Sanctum's middleware to your api middleware group within your application's app/Http/Kernel.php file:

'api' => [
            \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
            'throttle:api',
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

Step 8

Run database migrations To create the necessary database tables, run the following command:

php artisan automigrator:migrate

Step 9

Create a dummy user called John Doe Using tinker:

php artisan tinker

$user = new App\Models\User();
$user->password = Hash::make('johndoe');
$user->email = 'johndoe@johndoe.com';
$user->name = 'John Doe';
$user->is_admin = 1;
$user->username = 'johndoe';
$user->phone = '0723232323';
$user->save();

Step 10

Enable Laravel ERP modules Enable the Laravel ERP modules using the following command:

php artisan module:enable

Step 11

Run additional Laravel ERP migrations Run the following command to perform additional migrations specific to Laravel ERP:

php artisan mybizna:dataprocessor

Step 12

Generate an application key Generate an application key by running the following command:

php artisan key:generate

Step 13

Start the development server Start the Laravel development server using the following command:

php artisan serve

open the link http://127.0.0.1:8000/manage

Login using Username: johndoe and Password johndoe

Last updated