Laravel Stock Tracking Package

Laravel Stock is an inventory tracking package that tracks inventory numbers in models.

for example Book you may need to keep track of the stock of the model and HasStock You can start your inventory tracking by adding .

use Appstract\Stock\HasStock;
class Book extends Model
{
use HasStock;
}

When a customer orders for a book, you can change the number of stocks as follows:

$book->increaseStock(10);
$book->decreaseStock(10);
Change stock positively or negatively with one method
$book->mutateStock(10);
$book->mutateStock(-10);

Then you can check if a product is in stock in your user interface:

$book->inStock();
See if you have at least 10 of the same book in stock
$book->inStock(10);

Finally, you can clear stocks:

$book->clearStock();
Clear stock and then set a new value
$book->clearStock (10);

To learn more about this package and get full installation instructions, you can view the source code on GitHub at appstract /laravel-stock 

  Quote

KARABAY A, 2021 . Laravel Stock Tracking Package,

https://www.karabayyazilim.com/blog/laravel-stok-takip-paketi-2021-02-22-173731

(Accessed February 22, 2021).


  Share this post

Comments (0)

Comment

Subscribe
Sign up for the email newsletter to be the first to know about my blog posts