<?php

use App\Template;
use Illuminate\Database\Seeder;

class TemplateSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $this->template();
    }

    private function template()
    {
        $content = '<p style="text-align: center;"><img src="[backdrop_path]" alt="{WATCH|PUTL0CKER} [title] [year] {HD|1080p|FULLHD|720p}"><br></p><p style="text-align: center;"><b><a href="//demo.mopie.xyz/en/movie/[id]" title="Watch Now [title]" target="_blank">[WATCH NOW]</a></b></p><p style="text-align: left;"><b>[title]</b>&nbsp;- [overview].</p><p style="text-align: left;"><b>Release Date = </b>[release_date]&nbsp;</p><p style="text-align: left;"><b>Vote Count =</b> [vote_count]</p><p style="text-align: left;"><b>Vote Average =</b> [vote_average]&nbsp;</p><p style="text-align: left;"><span style="font-size: 0.9rem;"><b>Runtime =</b> [runtime]&nbsp;</span></p><p style="text-align: left;"><span style="font-size: 0.9rem;"><b>Budget =</b> [budget]</span></p>';

        $title = '{WATCH|PUTL0CKER} [title] [year] {HD|1080p|FULLHD|720p}';

        $type = ['movie', 'tv'];

        foreach ($type as $value) {
            $template = new Template;
            $template->name = "Sample {$value} template";
            $template->type = $value;
            $template->title = $title;
            $template->content = $content;
            $template->save();
        }
    }
}
