-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/nexco-lk/cms-laravel
- Loading branch information
Showing
5 changed files
with
98 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
{ | ||
// | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters