Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- Simple, fast routing engine.
- Powerful dependency injection container.
- Multiple back-ends for session and cache storage.
- Expressive, intuitive database ORM.
- Database agnostic schema migrations.
- Robust background job processing.
- Real-time event broadcasting.
Laravel is accessible, powerful, and provides tools required for large, robust applications.
Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
If you don't feel like reading, Laracasts can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.
In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [email protected]. All security vulnerabilities will be promptly addressed.
The Laravel framework is open-sourced software licensed under the MIT license.
Clone the repository
git clone https://github.com/weblineindia/Laravel-REST-API-Product-CRUD.git
Install all the dependencies using composer
composer install
Copy the example env file and make the required configuration changes in the .env file
cp .env.example .env
Generate a new application key
php artisan key:generate
Run the database migrations (Set the database connection in .env before migrating)
php artisan migrate
Generate a new passport authentication secret key
composer require laravel/passport
php artisan migrate
php artisan passport:install
General command list
git clone https://github.com/weblineindia/Laravel-REST-API-Product-CRUD.git
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate
composer require laravel/passport
php artisan migrate
php artisan passport:install
-
php artisan down
-> This command will put the maintenance mode screen if any page is accessed but won't bypass any functionality. -
php artisan up
-> This command will bring the website back online and functionality to access everything. -
Cache clear commands to use in root of the project if any changes done in routes folder files or clear cache for the project.
php artisan cache:clear php artisan route:clear php artisan route:cache php artisan view:clear php artisan config:clear php artisan config:cache
- Access the database using UI access or commandline and export it to some directory.
- Create new database on new database server.
- Update .env configuration file with database credentials.
Make sure you set the correct database connection information before running the migrations Environment variables
php artisan migrate
app
- Contains all the Eloquent modelsapp/Http/Controllers
- Contains all the controllersapp/Http/Middleware
- Contains the auth middlewareconfig
- 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 seederroutes/api
- Contains all the api routes defined in api.php fileroutes/web
- Contains all the web (frontend) routes defined in web.php file
-
Use below command
php artisan serve
-
Above command will start laravel project running
-
Use the URL from the terminal and paste it in the web browser
.env
- Environment variables can be set in this file
Note : You can quickly set the database information and other variables in this file and have the application fully working.
==========
This package automatically generates Swagger documentation for your Laravel API based on your annotations.
composer require darkaonline/l5-swagger After the installation is complete, publish the configuration file:
php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider" Open the generated configuration file located at config/l5-swagger.php and make sure the generate_always option is set to true:
'generate_always' => env('L5_SWAGGER_GENERATE_ALWAYS', true),
php artisan l5-swagger:generate
Please visit L5 Swagger Wiki for more information:
This package is a wrapper of Swagger-php and swagger-ui adapted to work with Laravel. The actual Swagger spec is beyond the scope of this package. All L5-Swagger does is package up swagger-php and swagger-ui in a Laravel-friendly fashion, and tries to make it easy to serve. For info on how to use swagger-php look here. For good examples of swagger-php in action look here.
We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development.
Happy coding! 😊