Have you seen there is a new 2022 series on Forge, it covers all aspects.
https://laracasts.com/series/learn-laravel-forge-2022-edition
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've hosted my app in Digital Ocean with Laravel Forge and have created a artisan command to run through schedule [Nightly].
The artisan command runs smoothly via terminal but returns No such file or directory while running it through Scheduled Jobsmanually from Laravel Forge.
The command for the job is:
php /home/forge/sitename.com/artisan Instagram:fetch
The artisan command php /home/forge/sitename.com/artisan Inspire i.e php artisan inspire returns the correct output.
While the above mentioned custom artisan returns No such file or directory
app\Console\Commands\FetchInstagram.php's handel method:
public function handle()
{ $instagram = new Instagram('api-key'); $posts = $instagram->media(); //gets 20 latest insta posts of a user // dd($posts); $fromDBs = Insta::orderBy('id', 'desc')->take(20)->get(); //get last 20 rows from table foreach( $posts as $post) { Insta::firstOrCreate([ 'thumb_link' => $post->images->thumbnail->url , 'standard_link' => $post->images->standard_resolution->url , 'caption' => $post->caption->text ]); } } Code from Kernel.php:
protected $commands = [ 'App\Console\Commands\FetchInstagram' ];
protected function schedule(Schedule $schedule) { $schedule->command('Instagram:fetch') ->daily(); }
Please or to participate in this conversation.