Untitled

 avatar
unknown
plain_text
a year ago
5.8 kB
8
Indexable
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class ComponentsController extends Controller
{
    public $components;

    public function __construct()
    {
        $this->components = [
            [
                'component' => 'Hero',
                'create'    => 'HeroModal',
                'edit'      => 'EditHero',
                'fields'   => [
                    [
                        [
                            'type' => 'text',
                            'title' => 'Title',
                            'placeholder' => 'Title',
                            'name' => 'title'
                        ],
                        [
                            'type' => 'text',
                            'title' => 'Description',
                            'placeholder' => 'Description',
                            'name' => 'description'
                        ],
                        [
                            'type' => 'image',
                            'title' => 'Image',
                            'placeholder' => 'Image',
                            'name' => 'image'
                        ],
                        [
                            'type' => 'text',
                            'title' => 'Button Title',
                            'placeholder' => 'Button Title',
                            'name' => 'button_title'
                        ],
                        [
                            'type' => 'text',
                            'title' => 'Button URL',
                            'placeholder' => 'Button URL',
                            'name' => 'button_url'
                        ],
                        [
                            'type' => 'button',
                            'name' => 'add_slider_items',
                            'title' => 'Add Slider Items',
                            'id' => 'add_slider_items',
                            'fields' => [
                                [
                                    [
                                        'type' => 'text',
                                        'title' => 'Title',
                                        'placeholder' => 'Title',
                                        'name' => 'title'
                                    ],
                                    [
                                        'type' => 'text',
                                        'title' => 'Description',
                                        'placeholder' => 'Description',
                                        'name' => 'description'
                                    ],
                                    [
                                        'type' => 'image',
                                        'title' => 'Image',
                                        'placeholder' => 'Image',
                                        'name' => 'image'
                                    ],
                                    [
                                        'type' => 'text',
                                        'title' => 'Button Title',
                                        'placeholder' => 'Button Title',
                                        'name' => 'button_title'
                                    ],
                                    [
                                        'type' => 'text',
                                        'title' => 'Button URL',
                                        'placeholder' => 'Button URL',
                                        'name' => 'button_url'
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ],
            [
                'component' => 'About',
                'create'    => 'AboutModal',
                'edit'      => 'EditAbout',
                'fields'   => [
                    [
                        [
                            'type' => 'text',
                            'title' => 'Title',
                            'placeholder' => 'Title',
                            'name' => 'title'
                        ],
                        [
                            'type' => 'text',
                            'title' => 'Description',
                            'placeholder' => 'Description',
                            'name' => 'description'
                        ],
                        [
                            'type' => 'button',
                            'name' => 'add_about_items',
                            'title' => 'Add About Items',
                            'id' => 'add_about_items',
                            'fields' => [
                                [
                                    [
                                        'type' => 'text',
                                        'title' => 'Title',
                                        'placeholder' => 'Title',
                                        'name' => 'title'
                                    ],
                                    [
                                        'type' => 'text',
                                        'title' => 'Description',
                                        'placeholder' => 'Description',
                                        'name' => 'description'
                                    ]
                                ]
                            ]
                        ]
                    ]
                ]
            ]
        ];
    }
    public function index()
    {
        return response()->json($this->components);
    }
}
Editor is loading...
Leave a Comment