The project is based on a marketplace with laravel 6
, where we have a stores and products registration, with routes for admin, shopkeepers and the store itself, where customers can make purchases directly on the system.
├── app/
├── config/
├── database/
├── public/
├── resources/
├── routes/
├── storage./
├── tests/
├── vendor/
├── artisan
├── composer.json
├── composer.lock
├── package.json
├── phpunit.xml
├── server.php
├── webpack.mix.js
├── yarn.lock
Open and view the Project using the .zip
file provided
Or to get started, clone the repository to your directory
> git clone https://github.com/akioleo/Marketplace_Laravel.git
Start the local development server
> php artisan serve
Install all the dependencies using composer
> composer install
Create a new .env archive based on .env.example
> php -r "copy('.env.example', '.env');"
Generate a new artisan key
> php artisan key:generate
In new .env
file type your database credentials in these lines
Obs: DB_CONNECTION changes by the database used. Example: Postgre database (pgsql), sqlite, sqlsrv
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
Include personal PagSeguro credentials
PAGSEGURO_ENV=sandbox
PAGSEGURO_EMAIL= <yourEmail>
PAGSEGURO_TOKEN_SANDBOX= <token>
PAGSEGURO_CHARSET=UTF-8
Run the database migrations to create predefined database tables
> php artisan migrate
Run seeds to populate the database with data we want to develop in future
> php artisan db:seed
We can check tools versions to avoid some errors
php --version | composer --version | laravel --version
Note : It's recommended to have a clean database before seeding. You can refresh your migrations at any point to clean the database by running the following command
> php artisan migrate:refresh
1:1 relationship - where one user hasOne store and one store belongsTo an user
$this->hasOne(Store::class);
$this->belongsTo(User::class);
1:N relationship - where one store hasMany products and one product belongsTo an store
$this->hasMany(Product::class);
$this->belongsTo(Store::class);
N:N relationship - where products belongsToMany categories and categories belongsToMany products
$this->belongsToMany(Product::class);
$this->belongsToMany(Category::class);
app
- Contains all the Eloquent modelsapp/Http/Controllers/Api
- Contains all the api controllersapp/Http/Middleware
- Contains the JWT auth middlewareapp/Http/Requests/Api
- Contains all the api form requestsapp/Payment/PagSeguro/CreditCard
- Contains payment rulesapp/Traits/UploadTrait
- Contains all traits of projectconfig
- Contains all the application configuration filesdatabase/factories
- Contains the model factory for all the modelsdatabase/migrations
- Contains all the database migrationsdatabase/seeds
- Contains the database seederpublic/assets
- Contains public assets of projectresources/views
- Contains blade documents (front-end)routes
- Contains all the api routes defined in api.php filestorage/app
- Contains private photostests
- Contains all the application teststests/Feature
- Contains all the api testsvendor
- Includes the Composer dependencies in the file autoload..env
- A simple text configuration file for controlling your Applications environment constants.composer.json
- Contains a project name, version and a few other detailscomposer.lock
- Records the exact versions that are installedpackage.json
- Contains few packages such as vue and axios to help you get started building your JavaScript applicationphpunit.xml
- A testing utility included by default in a fresh installation of Laravel
We'd love to have your helping hand on Marketplace
. If you have any contribuition, we can rate some pull requests.
Marketplace
is open source software licensed as MIT.