Commit ba184106 by Aan Choesni Herlingga

front error

parent f839aeb4
<?php
namespace App\Http\Controllers\Webprofile\Front;
use App\Http\Controllers\Controller;
use App\Models\Webprofile\Design;
use App\Models\Webprofile\Menu;
use App\Models\Webprofile\Pages;
use Session;
class ErrorController extends Controller
{
public function index()
{
$setting = webprofilesetting();
if (!Session::has('selected_language')) {
session(['selected_language' => 'id']);
}
if (Session::get('selected_language') == 'id') {
$data = $this->getDataId($setting);
return view('webprofile.front.' . $setting['theme'] . '.page', $data);
} else if (Session::get('selected_language') == 'en') {
$data = $this->getDataEn($setting);
return view('webprofile.front.' . $setting['theme'] . '.page', $data);
}
}
public function getDataId($setting)
{
$setting = webprofilesetting();
$data = new Pages;
$data->title = 'Page Not Found';
$menu = Menu::orderby('urutan', 'asc')->get();
$widget_right = Design::where('name_design', 'widget_right')->orderBy('urutan', 'ASC')->get();
$widget_left = Design::where('name_design', 'widget_left')->orderBy('urutan', 'ASC')->get();
$data = [
'setting' => $setting,
'data' => $data,
'menu' => $menu,
'widget_right' => $widget_right,
'widget_left' => $widget_left,
];
return $data;
}
public function getDataEn($setting)
{
$setting = webprofilesetting();
$data = new Pages;
$data->title = 'Page Not Found';
$menu = Menu::with(['rEn'])->orderby('urutan', 'asc')->get();
$widget_right = Design::where('name_design', 'widget_right')->orderBy('urutan', 'ASC')->get();
$widget_left = Design::where('name_design', 'widget_left')->orderBy('urutan', 'ASC')->get();
$data = [
'setting' => $setting,
'data' => $data,
'menu' => $menu,
'widget_right' => $widget_right,
'widget_left' => $widget_left,
];
return $data;
}
}
......@@ -7,7 +7,7 @@ Route::group(['namespace' => 'Webprofile\Front'], function () {
Route::get('category/{id}','CategoryController@index')->name('category');
Route::get('information/{id}', 'InformationController@index')->name('infomation');
Route::get('agenda', 'AgendaController@index')->name('agenda');
Route::get('error', 'FrontController@error')->name('error');
Route::get('error', 'ErrorController@index')->name('error');
Route::get('download', 'FrontController@download')->name('download');
Route::get('downloadlink/{data}', 'FrontController@downloadFile')->name('downloadFile');
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment