This source code contain the below functionalities
- Login using JWT auth
- Show all the products (Listing product)
- Products listing should have pagination
- Provide a form to add the Product and also need a way to upload the product image
- Laravel server requirements
- Laravel 5.5 requires PHP 7.1 or later
- Clone the repository
- Run
composer install
- Configure Laravel directory permissions (documentation)
- Create a database and setup the database configuration inside
.env
- Run
php artisan key:generate
- Run
php artisan migrate
- If you have the below error while doing migration
Just put the below code in your
AppServiceProvider.php
fileuse Illuminate\Support\Facades\Schema; public function boot() { Schema::defaultStringLength(191); }
- Delete the all tables from Database and run again the command
php artisan migrate
- Run
php artisan jwt:secret
- Run
npm install
- Use
php artisan tinker
to create a test user:
App\User::create(['name' => 'Test User', 'email' => '[email protected]', 'password' => Hash::make('Password01')])
- Setup the configuration file for VueJS, So just need to create
env.js
file inside theresources/assets/js/
Directory. Put the below code in it and replace your folder name of project
const configuration = {
api_url : "http://localhost/{project-directory-name}/public/api",
api_version : '/v1'
}
export default configuration
- Once you have made changes to the JavaScript or SCSS files you will want to run
npm run dev
ornpm run production
- Please download the sampleImport Template and put your data according to columns and try to upload products