<?php

namespace Ignite\Core\Database\Seeders\Strategy;

use Ignite\Core\Contracts\Database\SeederStrategy;

class Json extends AbstractStrategy implements SeederStrategy
{
    /**
     * Run the seeder using this strategy.
     *
     * @return \Illuminate\Support\Collection
     */
    public function run()
    {
        $contents = file_get_contents($this->getFilepath());
        $source = json_decode($contents, true);

        return collect($source['data']);
    }
}
