<?php

namespace Amwdeveloper\plugins\sliders;

use Amwdeveloper\model\layer;

class home extends layer
{
    public function index()
    {
        $sliders = $this->table("amw_slider")->columns("title,image")->orderby("id")->all();
        $setSlider = array();

        if ($sliders) {
            foreach ($sliders as $slider) {
                $setSlider[] = [
                    'title' => $slider->title,
                    'image' => $slider->image,
                ];
            }

            return $setSlider;
        }

        return null;
    }
}
