Learn Laravel 9 API - Build CRUD | #3 Setup Product Resource and Make Function Read
1 - ProductResource.php 2 - ProductController.php 3 - Add in route 4 - Testing via Postman
1 - ProductResource.php 2 - ProductController.php 3 - Add in route 4 - Testing via Postman
In this article, we will learn how to config database, create model, migration, controller, and resources. And also explaination about that. 1 - Create Model Open new terminal on your project (laravel-api-blog), and type: php artisan make:model Product -m This action will make 2 files: app/Models/Product.php In this file, add some code: Explaination: protected $fillable used for input/update data, you need to register the field name for mass assigment. products_table.php (in database/migrations)...
We will start to build API project using Laravel 9, and in this article we will learn how to install laravel 9 in easy way. In this project, we will install Laravel using Laragon. We also will learn how to upload images in API using laravel 9, and simulate the data using API. We use windows 10 to build this project. 1 - Install Git CLI Download and install git from here: https://git-scm....