<?php

namespace App\Console\Commands;

use App\Models\Post;
use Illuminate\Console\Command;

class ImportPosts extends Command
{
    protected $signature = 'import:posts';

    protected $description = 'Import posts into Algolia without clearing the index';

    public function __construct()
    {
        parent::__construct();
    }

    public function handle()
    {
        $posts = Post::all();
        $posts->searchable();
        $this->info('Posts have been imported into Algolia.');
    }
}
