Skip to main content

Supported Versions of Laravel

Laravel 11+ are supported. It feels like this section needs more than one sentence but it really doesn’t. That first one said all that needs saying.

Install Shopper

Shopper is really easy to install. After creating your new app or in an existing Laravel app (11+). There are 2 steps to follow to install Shopper.
  1. Clear to cached config by running the following command:
    php artisan config:clear
    
  2. Install shopper/framework package with Composer from your project root.
    composer require shopper/framework --with-dependencies
    

Prepare your User Model

Shopper relies on your User model having certain relationships and methods set up to handle authentication, permissions, and admin panel access. Rather than asking you to manually add all of these, we’ve bundled them into a trait and an interface for convenience. Add the ShopperUser trait and implement the ShopperUser interface to your User model (usually app/Models/User.php):
app/Models/User.php
use Shopper\Core\Models\Contracts\ShopperUser as ShopperUserContract;
use Shopper\Core\Traits\ShopperUser;

class User extends Authenticatable implements ShopperUserContract
{
    use ShopperUser;

    protected $hidden = [
        'password',
        'remember_token',
        'last_login_at', 
        'last_login_ip',
        'two_factor_recovery_codes',
        'two_factor_secret',
    ];
}
The trait provides essential relationships for roles, permissions, and two-factor authentication. The interface ensures your model adheres to the contract expected by Shopper’s core features.
After installing all dependencies in your project via compose and setup the database, now we will automatically install by running the following commands in your Laravel project directory:
  php artisan shopper:install
This will install shopper, publish vendor files, create shopper and storage symlinks if they don’t exist in the public folder, run migrations and seeders classes.
By default, all shopper tables are prefixed with sh_ to avoid conflicts with existing tables in your database. But you can update this configuration according to your need
And we’re all good to go!

Create an Admin user

Now we can create a new superuser and sign in into the Dashboard and start creating some content. Run the following command to create a user with supreme (at the moment of creation) rights:
php artisan shopper:user

New Shopper Directory

After Shopper is installed, you’ll have 1 new directory in your project:
  • config/shopper/

Publish Vendor Files

If you want to publish again Shopper’s vendor files run these commands:
php artisan shopper:publish

Running Your Application

To run your application locally, you can use Laravel’s built-in development server:
php artisan serve
Then visit http://localhost:8000/cpanel/login to access the admin panel.
We highly recommend using Laravel Herd for local development. It provides a blazing fast, native development environment for Laravel with zero configuration required.
If you’re using Laravel Herd or Laravel Valet, you can access your application directly using the .test domain:
http://your-project-name.test/cpanel/login