chrisbraybrooke / laravel-ecommerce
A laravel ecommerce solution.
Installs: 206
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 0
Open Issues: 14
Language:JavaScript
Requires
- php: >=5.4.0
- anlutro/l4-settings: ^0.6.0
- barryvdh/laravel-snappy: ^0.4.1
- illuminate/config: ~5.0
- illuminate/support: ^5.6
- laravel/framework: 5.6.*
- laravel/passport: ^6.0
- maatwebsite/excel: ^3.1
- olssonm/l5-zxcvbn: ^3.1
- spatie/laravel-activitylog: ^2.3
- spatie/laravel-medialibrary: 6.9.0
- spatie/laravel-permission: ^2.7
- stripe/stripe-php: ^6.4
Requires (Dev)
- phpunit/phpunit: ~4.0
- dev-master
- 1.0.02
- 0.1.32
- 0.1.31
- 0.1.30
- 0.1.29
- 0.1.28
- 0.1.27
- 0.1.26
- 0.1.25
- 0.1.24
- 0.1.23
- 0.1.22
- 0.1.21
- 0.1.20
- 0.1.19
- 0.1.18
- 0.1.17
- 0.1.16
- 0.1.15
- 0.1.14
- 0.1.13
- 0.1.12
- 0.1.11
- 0.1.10
- 0.1.09
- 0.1.08
- 0.1.07
- 0.1.06
- 0.1.05
- 0.1.04
- 0.1.03
- 0.1.02
- 0.1.1
- 0.1.00
- 0.0.99
- 0.0.98
- 0.0.97
- 0.0.96
- 0.0.95
- 0.0.94
- 0.0.93
- 0.0.91
- 0.0.90
- 0.0.89
- 0.0.88
- 0.0.87
- 0.0.86
- 0.0.85
- 0.0.84
- 0.0.83
- 0.0.82
- 0.0.81
- 0.0.80
- 0.0.79
- 0.0.78
- 0.0.77
- 0.0.76
- 0.0.75
- 0.0.74
- 0.0.73
- 0.0.72
- 0.0.71
- 0.0.70
- 0.0.69
- 0.0.68
- 0.0.67
- 0.0.66
- 0.0.65
- 0.0.64
- 0.0.63
- 0.0.62
- 0.0.61
- 0.0.60
- 0.0.59
- 0.0.58
- 0.0.57
- 0.0.56
- 0.0.55
- 0.0.54
- 0.0.53
- 0.0.52
- 0.0.51
- 0.0.50
- 0.0.49
- 0.0.48
- 0.0.47
- 0.0.46
- 0.0.45
- 0.0.44
- 0.0.43
- 0.0.42
- 0.0.41
- 0.0.39
- 0.0.38
- 0.0.37
- 0.0.36
- 0.0.35
- 0.0.34
- 0.0.33
- 0.0.32
- 0.0.31
- 0.0.30
- 0.0.29
- 0.0.28
- 0.0.27
- 0.0.26
- 0.0.25
- 0.0.24
- 0.0.23
- 0.0.21
- 0.0.19
- 0.0.18
- v0.0.17
- 0.0.16
- 0.0.15
- 0.0.14
- 0.0.13
- 0.0.12
- 0.0.11
- 0.0.4
- 0.0.2
- 0.0.1
- dev-dependabot/npm_and_yarn/ua-parser-js-and-browser-sync-1.0.35
- dev-dependabot/npm_and_yarn/minimist-and-loader-fs-cache-and-mkdirp-1.2.8
- dev-dependabot/npm_and_yarn/debug-2.6.9
- dev-dependabot/npm_and_yarn/ms-2.0.0
- dev-dependabot/npm_and_yarn/jquery-3.5.0
- dev-dependabot/npm_and_yarn/jszip-3.8.0
- dev-dependabot/composer/guzzlehttp/psr7-1.9.1
- dev-dependabot/composer/knplabs/knp-snappy-1.4.2
- dev-dependabot/composer/phpseclib/phpseclib-2.0.41
- dev-dependabot/composer/symfony/http-kernel-4.4.50
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-dependabot/npm_and_yarn/axios-0.21.1
- dev-dependabot/composer/symfony/http-foundation-4.4.7
- dev-dependabot/composer/symfony/mime-4.4.7
- dev-form-field-key
- dev-item-order-pivot
- dev-dev
This package is auto-updated.
Last update: 2024-05-06 08:28:21 UTC
README
Laravel Setup
laravel new laravel-shop php artisan make:auth
Installation
Only installation on a fresh Laravel app is reccomended:
composer require chrisbraybrooke/laravel-ecommerce
Setup:
php artisan vendor:publish --tag=migrations php artisan vendor:publish --tag=ecommerce-config php artisan vendor:publish --tag=ecommerce-migrations php artisan vendor:publish --tag=ecommerce-admin php artisan migrate
Roles And Permissions:
php artisan vendor:publish --tag=ecommerce-seeds
In database/seeds/DatabaseSeeder.php
add the RolesAndPermissionsSeeder class
use Illuminate\Database\Seeder; class DatabaseSeeder extends Seeder { /** * Seed the application's database. * * @return void */ public function run() { // $this->call(UsersTableSeeder::class); $this->call(RolesAndPermissionsSeeder::class) } }
And then seed the database
php artisan migrate --seed
Media:
php artisan vendor:publish --tag=config
After publishing the config files, be sure to change the media class to ChrisBraybrooke\ECommerce\Models\Media
/* * The class name of the media model that should be used. */ 'media_model' => ChrisBraybrooke\ECommerce\Models\Media::class,
Users:
To ensure all roles / permissions work correctly, you will need to edit your App/User.php
class so that it extends the Laravel Ecommerce User class.
use Illuminate\Notifications\Notifiable; use ChrisBraybrooke\ECommerce\Models\User as Authenticatable; class User extends Authenticatable { use Notifiable; }
You will then want to create your first admin user.
php artisan tinker $user = new App\User $user->name = 'Your Name' $user->email = 'youremail@here.com' $user->password = bcrypt('password') $user->save() $user->assignRole('admin')
We use Laravel Passport under the hood, so make sure you install passport to generate the relevent keys etc.
php artisan passport:install
You then need to add this middleware to your app/Http/Kernel.php
web group. Make sure it is added after the \App\Http\Middleware\EncryptCookies::class
middleware.
'web' => [ // Other middleware... \Laravel\Passport\Http\Middleware\CreateFreshApiToken::class, ],
Finally in your config/auth.php
config file, you should set the API driver to passport.
'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver' => 'passport', 'provider' => 'users', ], ],
Updating the version
It's a good idea to keep the version numbering up-to-date with any minor and major changes that are made to avoid conflicts with older code. This package uses seperate version numbers for its API and SPA functions.
The API version number can be found and changed under src/ECommerceServiceProvider.php
And the SPA version number can be found and changed under resources/assets/admin-spa/admin.js
(this one will require compiling).