Education is an ERP System offering a complete school management system with staff, student expenses and report management functionality. The Application is built in Laravel 8 and is a complete end-to-end CMS (Content Management System) and is highly customizable. The initial project is a starter project with lots of room for improvement in terms of features and functionality that can be built upon. Multi authentication system built using Laravel Jetstream with User and Admin logins.
Hosted on Heroku on a ClearDB MySQL Database, using JetBrains DataGrip to connect to the database.
Prior to deploying the application the following considerations need apply.
- Configuration Caching
- To give your application a speed boost, you should cache all of your configuration files into a single file using the config:cache Artisan command. This will combine all of the configuration options for your application into a single file which can be quickly loaded by the framework. See here
- Run:
php artisan config:cache
- Application cache
- The application cache is the primary cache in Laravel. It stores everything that you manually cache in your application. You can clear only specific elements of the cache if you use tags or different cache stores. The easiest way to clear the Laravel cache is via artisan:
- Run:
php artisan cache:clear
- View cache
- Another part of the application that has a cache is the view cache. The view cache stores rendered Blade templates to speed up your application. You can manually render all views to increase the performance by using the artisan command for it:
- Run:
php artisan view:clear
- Download/Clone Project
- Run
composer install
within the project directory to install dependencies for the project (ensure composer is installed on your system) - Create the
education_erp
database within phpMyAdmin Panel - Run
php artisan migrate:fresh
to migrate the database - Rename
env.example
to.env
(sample environment variables for Laravel) and populate with your details:- Set up a mailtrap account to enable reset password, and confirm account functionality. Required Step.
- Populate the file with the details from your mailtrap account.
- Run
php artisan serve
to starting a Laravel development server on http://127.0.0.1:8000 - Create an account
- Go into the phpMyAdmin panel and assign a usertype of
Admin
to your user record.
- Go into the phpMyAdmin panel and assign a usertype of
- Login to Dashboard
http://127.0.0.1:8000
- Compress the project folder by adding to a .zip directory for uploading to the server and extracting.
- Create a MySQL database with your hosting provider and import the
education_erp.sql
file to create the tables and populate the data. - Update the database configuration in the
.env
file (e.g. database name, username, password etc.) - Errors?
Specified key was too long?
:HTTPS Errors?
Update the following in AppServiceProvider.php
the code should be self explainatory.
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\URL;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
Schema::defaultStringLength(191);
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
if(config('app.env') === 'production') {
URL::forceScheme('https');
}
}
}
Credentials for this project are redacted for security reasons. Step-by-step instructions below.
git init
git add .
git commit -m "new laravel project"
This is required to tell Heroku where to serve the project from. i.e. with Laravel this must be from the public folder.
echo "web: vendor/bin/heroku-php-apache2 public/" > Procfile
git add .
git commit -m "Procfile for Heroku"
heroku create
- Set a Laravel encryption key
php artisan key:generate --show
heroku config:set APP_KEY=<your_app_key_goes_here>
- Set a Laravel encryption key
- Deploy
git push heroku master
- Configure Add-ons
- Select
ClearDB MySQL
- This will generate a MySQL database and generate credentials (connection string with database name, username, password) in Config Vars (
CLEARDB_DATABASE_URL
)
- This will generate a MySQL database and generate credentials (connection string with database name, username, password) in Config Vars (
- Select
Key | Value |
---|---|
APP_KEY | <your_app_key_goes_here> |
CLEARDB_DATABASE_URL | <automatically_generated> |
APP_DEBUG | False |
DB_CONNECTION | mysql |
DB_DATABASE | <database_name_goes_here> |
DB_HOST | <host_goes_here> |
DB_PASSWORD | <password_goes_here> |
DB_PORT | 3306 |
DB_USERNAME | <username_goes_here> |
APP_ENV | production |
- Settings
- Run Console
php artisan migrate:fresh
- Run Console
Use a tool such as DataGrip by JetBrains to connect to the Database remotely.
- Create a user through the Admin Panel Login
- Update the record in the database and add
Admin
to theusertype
field in the record to access admin features.
- Update the record in the database and add
- Within
AppServiceProvider.php
inside theboot
function add the following
use Illuminate\Support\Facades\URL;
public function boot()
{
//
if(config('app.env') === 'production') {
URL::forceScheme('https');
}
}
If errors occur, add the following to the register
function within the same file:
use Illuminate\Support\Facades\Schema;
public function register()
{
//
Schema::defaultStringLength(191);
}