Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

tighten/novapackages

336 stars
2 code files
View tighten/novapackages on GitHub

app/Jobs/CheckPackageUrlsForAvailability.php

Open in GitHub
use App\Notifications\NotifyAuthorOfUnavailablePackageUrl;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
 
class CheckPackageUrlsForAvailability implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
 
public function handle()
{
if ($this->package->author && $this->package->authorIsUser()) {
$this->package->author->user->notify(new NotifyAuthorOfUnavailablePackageUrl($this->package));
}
}
}

app/Console/Commands/CheckPackageUrls.php

Open in GitHub
use App\Jobs\CheckPackageUrlsForAvailability as CheckPackageUrlsJob;
use App\Package;
use Illuminate\Console\Command;
 
class CheckPackageUrls extends Command
{
public function handle()
{
$validPackages = Package::whereNull('marked_as_unavailable_at')
->with('author')
->get();
 
foreach ($validPackages as $package) {
dispatch(new CheckPackageUrlsJob($package));
}
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.