<?php

namespace Rvsitebuilder\Wysiwyg\Http\Controllers\Backend;

use Illuminate\Routing\Controller;
use Rvsitebuilder\Manage\Models\CoreApps;

class SystempageController extends Controller
{
    public function systemData()
    {
        $system = [];
        $module = CoreApps::with([
                'getSystemPage' => function ($query) {
                    $query->select([
                            'app_id',
                            'page_name',
                            'id',
                    ]);
                },
                'getSystemPage.getSlug' => function ($query) {
                    $query->select([
                            'slugble_id',
                            'slugble_type',
                            'slug_name',
                    ]);
                },
        ])->has('getSystemPage')->where('active', '1')->get();

        return response()->json($module);
    }
}
