Flex
98
10
Laravel

How to automatically delete database record using Laravel Queues?

Posted 6 months ago by Flex

I am working with laravel 5.6 and I need delete a records which old than 15 days from now from vehicles table daily. I am workin in windows 7 and localhost is WAMP. I need following like code to run,

$vehicles = Vehicle::where('created_at', '<', Carbon::now()->subDays(15))->get();

foreach ($vechicles as $vehicle) {
    $vehicle->delete();
}

and I do not hope to use Task Sheduler because I am using windows So, My first question is may I do such as activity using laravel Queues? and if it is so, How to do this?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.