This is the simplest example of the use of Laravel to implement a registration, edition and removal system of supermarket products organised by location.
The database used is mySql. A single able was used to store products and locations with these properties:
- id
- name
- location
- timestamps (automatically generated by Laravel)
There is a single model: - Product That holds its objects properties.
There is a single screens:
- index from where is possible to make all operations over the system.
There is a single controller: - ProductController that provides methods for CRUDing items Here is an extra method to get json data for AJAX calls
The Controller's methods are accessible through its own route - /products and HTTP methods:
- GET
- POST
- DELETE
An ajax function is called every 2 seconds to retrieve new items from the database.