0

I am wondering if there's any way to run an ad-hoc command in laravel? like in tinker, but without tinker?

I want to be able to run an ad-hoc command but without using tinker ?

Example:

"App\Post::orderBy('timestamp', 'desc')->first()"

I want to run this every 5 seconds?

  • Check out [Task Scheduling](https://laravel.com/docs/5.5/scheduling) – linktoahref Nov 28 '17 at 09:31
  • 1
    @linktoahref Task Scheduling (and cronjobs) are nice, but are limited to once per minute. Every 5 seconds sounds like a task for NodeJS. – online Thomas Nov 28 '17 at 09:41
  • I know they are limited, thats why the guys that are commenting its kinda not helping much. I know how to create cron jobs or artisan commands but nothing that I want –  Nov 28 '17 at 09:53

1 Answers1

0

Yes you can write orn comands in artisan. It is very useful.

Classes are kept in app/console

More: https://laravel.com/docs/5.5/artisan

Adam Kozlowski
  • 5,606
  • 2
  • 32
  • 51