Skip to main content

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

Read more here

nabilhassen/larasense

62 stars
2 code files
View nabilhassen/larasense on GitHub

app/Models/Publisher.php

Open in GitHub
use Illuminate\Contracts\Database\Eloquent\Builder;
 
class Publisher extends Model
{
// ...
 
public function scopeTracked(Builder $query): void
{
$query->where("{$this->getTable()}.is_tracked", 1);
}
 
public function scopeNotTracked(Builder $query): void
{
$query->where("{$this->getTable()}.is_tracked", 0);
}
 
// ...
}

app/Console/Commands/LarasenseBotCommand.php

Open in GitHub
use App\Jobs\SyncSourceFeed;
use App\Models\Source;
use Illuminate\Console\Command;
 
class LarasenseBotCommand extends Command
{
// ...
 
public function handle()
{
foreach (Source::tracked()->get() as $source) {
SyncSourceFeed::dispatch($source);
}
}
}

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.