Current File : //home/tradevaly/www/app/Http/Controllers/CronjobController.php
<?php

namespace App\Http\Controllers;
use Illuminate\Support\Facades\Auth;
use App\Models\Banner;
use App\Models\User;
use Carbon\Carbon;

class CronjobController extends Controller
{
    public function advertisement($country){
      $banners =   Banner::where('isActive', 1)->whereNotNull('link')->whereNotNull('image')->whereNotNull('user_id')->whereDate('end', '>=', Carbon::now())->latest()->get();
       foreach($banners as $banner){
          $user = User::find($banner->user_id);
          dd($banner->advetisement);
          
             $invoiceData = (object) [
                'id' => $advertiser->id,
                'banner_id' => $banner->id,
                'name' => $user->name,
                'advertisment_place' => $advertiser->position,
                'created_at' => $transaction->created_at,
            ];
            
            
           print_r('user id '.$banner->user_id.'<br/>');
       }
       die();
        abort(404);
    }
    
}