Laravel Stock is an inventory tracking package that tracks inventory numbers in models.
Book you may need to keep track of the stock of the model and
HasStock You can start your inventory tracking by adding .
class Book extends Model
When a customer orders for a book, you can change the number of stocks as follows:
Change stock positively or negatively with one method
Then you can check if a product is in stock in your user interface:
See if you have at least 10 of the same book in stock
Finally, you can clear stocks:
Clear stock and then set a new value
To learn more about this package and get full installation instructions, you can view the source code on GitHub at appstract /laravel-stock