Currently I am developing a small to middle level application in laravel I came across middleware in laravel, My question is Can i use middleware for making changes in my table for eg, In my application(Canteen Management System), When user orders something from the menu and make request for order then before inserting the order into the model table i want to subtract the order amount from his balance. Reason i am thinking of doing this is because balance attribute is a part of user table and order amount is another part of Order table and i am not being able to develop any data relation between them (but I derive many to one relation between them). So i am not thinking of doing only this thing using data relationship , So that's when i come accross middleware. So help me about this, also Can i use two model in one controller function ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire