Closed mrahmadt closed 5 years ago
I will look into this over the next few days and see if I can add a command to execute on the model directly. In the meanwhile you can execute the artisan command from inside your code:
artisan()->call("modelCache:clear", ["--model" => <ModelName>::class]);
Many Thanks
Also, if you use the insert command on the model, instead of the DB
Facade, it should invalidate the cache.
@mrahmadt Ah! never mind, I already had the functionality included:
$model->flushCache();
It slipped my mind. Sorry.
Hello
In my project I have to insert bulk data to a database table (100 to 400 records) per app user, I use raw SQL with DB:insert() to do the insert (I want to have the insert as fas as possible)
Now the issue is after the bulk insert I'm not able to Invalidate the cache to get the new records.