Install Chandra
We use good number of packages to provide great functionality without re-inventing wheel.
We need to add those packages to composer.json
, publish vendor configurations and finally do migrations.
packages used
Package name
repo
manual
cartalyst/sentinel
laravelcollective/html
cviebrock/eloquent-sluggable
cviebrock/eloquent-taggable
Delete existing migration files
Since we are not relying on default migration tables, please remove following two files from database/migrations
folder
Otherwise you will get error at later stage of installation.
Add middlware
Chandra ships with two middlewares one for admin and another for user.
To be able to use them, we should define them in app\Http\Kernel.php
Open app\Http\Kernel.php
and in $routeMiddleware
add following
Install Packages
Add Package to composer
Now add above mentioned packages in composer.json
in require
array
update vendors
now hit composer update
in terminal to download above packages.
Add service providers
Open config/app.php
and add following lines in the $providers
array
In the $aliases
array add following facades
publish vendors
now we need to publish vendor files so that they will publish config files, migrations.
Excecute following command in command prompt/terminal
Now we need to add user, groups etc tables to database, to do so in your command prompt, execute following code
Note: please check all files in database\migrations
to know what fields are being added.
setting up config to use our model
since we have different requirements (extra fields in users table), we need to change sentinel config to use our user Model,
to do that open config/cartalyst.sentinel.php
at line 56, find
replace it with
Add admin user
As database tables have been setup, we need to add admin user to be able to login into adminCP.
Run following command in your command prompt
A default admin user with user with username admin@admin.com and password admin will be created
Optional: If you wish to use a different username or password, please open database\seeds\AdminSeeder.php
and edit values around lines 14-18
upload directory permissions
user's profile pics will be uploaded into public/uploads/users
so we need to provide write access for that folder
to do so, please run following command in your command prompt/terminal
Congratulations! You are ready to rock the world!!
Last updated