Skip to content

Commit

Permalink
Merge pull request #299 from nexco-lk/rendering-issue-fix-phase-1
Browse files Browse the repository at this point in the history
rendering issue fix phase 1
  • Loading branch information
curtisdelicata authored Sep 26, 2024
2 parents 4307c49 + 0fffbf3 commit 61305df
Show file tree
Hide file tree
Showing 11 changed files with 278 additions and 218 deletions.
89 changes: 89 additions & 0 deletions app/Http/Controllers/WebRenderController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\GuestLayoutManagment;
use App\Models\Menu;

class WebRenderController extends Controller
{
public $contents;

public function __construct(Request $request)
{
$this->contents = $this->getModules($request->path());
}

public function getModules($url){
$menu = Menu::where('url', $url)->first();
$contents = GuestLayoutManagment::where('fk_menu_id', $menu->id)->get()->toArray();
if ($contents) {
$elements = [];
foreach ($contents as $content) {
if($content['is_active'] != 0) {
$elements[$content['sort_order']] = $content;
}
}
}
return $elements ?? [];
}

/**
* Display a listing of the resource.
*/
public function index()
{
return view('livewire.webrender', [
'contents' => $this->contents
]);
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}

/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}

/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}

/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}
212 changes: 0 additions & 212 deletions public/build/assets/app-C70TPxWk.js

This file was deleted.

179 changes: 179 additions & 0 deletions public/build/assets/app-DUisMNEx.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/build/assets/app-av2AYTCr.css

This file was deleted.

1 change: 1 addition & 0 deletions public/build/assets/app-gyuvcUs_.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/build/assets/theme-BA_2FX-f.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/build/assets/theme-BJv1THbF.css

This file was deleted.

6 changes: 3 additions & 3 deletions public/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"resources/css/app.css": {
"file": "assets/app-av2AYTCr.css",
"file": "assets/app-gyuvcUs_.css",
"src": "resources/css/app.css",
"isEntry": true
},
"resources/css/filament/admin/theme.css": {
"file": "assets/theme-BJv1THbF.css",
"file": "assets/theme-BA_2FX-f.css",
"src": "resources/css/filament/admin/theme.css",
"isEntry": true
},
"resources/js/app.js": {
"file": "assets/app-C70TPxWk.js",
"file": "assets/app-DUisMNEx.js",
"name": "app",
"src": "resources/js/app.js",
"isEntry": true
Expand Down
1 change: 1 addition & 0 deletions resources/views/livewire/webrender.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<x-guest-layout>
<div>

@if ($contents)
@foreach ($contents as $element)
@include('partials.content-element', ['content' => $element['content']])
Expand Down
4 changes: 3 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

use App\Http\Controllers\WebRenderController;
use App\Http\Livewire\Homepage;
use App\Livewire\About;
use App\Livewire\Contact;
Expand All @@ -17,4 +19,4 @@
*/

Route::get('/', Webrender::class);
Route::get('/{dynamicUrl}', Webrender::class);
Route::get('/{dynamicUrl}', [WebRenderController::class, 'index']);
1 change: 1 addition & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import laravel from 'laravel-vite-plugin';
import { viteStaticCopy } from "vite-plugin-static-copy";

export default defineConfig({
base: '/',
plugins: [
laravel({
input: [
Expand Down

0 comments on commit 61305df

Please sign in to comment.