public function show($id) { $lesson = Lesson::find($id); $ratings = []; if (!$lesson) { return response('Leeson not found', 404); } if ($lesson->enabled) { $length = 90; //minute $now = new Carbon(); if ($lesson->updated_at->diffInMinutes($now) > $length) { $lesson->enabled = 0; $lesson->save(); } } else { $ratings = Rating::withTrashed()->where('lesson_id', '=', $id)->get()->all(); } $bookmarks = $lesson->bookmarks->sortBy('bookmarked_at'); foreach ($bookmarks as $bookmark) { $bookmark->bookmarked_at = new Carbon($bookmark->bookmarked_at); } $settings = Setting::all(); return response()->view('lesson.show', ['lesson' => $lesson, 'ratings' => $ratings, 'bookmarks' => $bookmarks, 'settings' => $settings]); }
/** * Bootstrap any application services. * * @return void */ public function boot() { foreach (Setting::all() as $setting) { $exp = explode("_", $setting->name); config([$exp[0] . "." . $exp[1] => $setting->value]); } }
public function edit() { $settings = []; foreach (Setting::all() as $setting) { $settings[$setting->name] = $setting->value; } return view("realestateadmin::settings.edit", ["settings" => $settings]); }
/** * Bootstrap any application services. * * @return void */ public function boot() { $settingsval = Setting::all(); foreach ($settingsval as $val) { $data[$val->config_key] = $val->config_value; } View::share('_settings_data', (object) $data); }
public static function allSetting() { $settingobj = Setting::all(); $return = array(); foreach ($settingobj as $o) { $return[$o->name] = $o->value; } return $return; }
/** * Display a listing of the resource. * * @return Response */ public function index() { // $settings = Setting::all(); $data['main_tilte'] = 'Advisor Panel'; $data['sub_title'] = "List Advisor"; $date['services'] = $settings; return view('advisor.setting_list')->with('settings', $settings); }
public static function getSettingsArr() { return \Cache::rememberForever('settings_array', function () { /*$aa=\App\Setting::all(); $settings=array(); foreach($aa as $setting) { $settings[$setting->name]=$setting->value; }*/ $settings = \App\Setting::all()->lists('value', 'name'); return $settings; }); }
/** * Register the service provider. * * @return void */ public function register() { // //$params = null; //foreach (Setting::all() as $key => $value){ // $params[]=[$key=>$value]; //} View::composer('*', function ($view) { $settings = Setting::all(); foreach ($settings as $data) { $param = array_values($data['attributes']); $params[$param[0]] = $param[1]; } $view->with('settings', $params); }); // die ('lol'); }
public function index() { if (Request::isMethod('get')) { $lang = Language::all(); $settings = Setting::all(); return view('admin.settings.index', array('langs' => $lang, 'settings' => $settings)); } /// POST $data = Request::all(); $s = new Setting(); $s->name = $data['name']; $s->lang_code = $data['lang_code']; $s->value = $data['value']; $s->type = 'var'; $s->save(); return redirect('admin/settings'); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show(Request $request, $formKey) { $settings = Setting::all(); foreach ($settings as $settingval) { $data[$settingval->config_key] = $settingval->config_value; } $data['formkey'] = trim($formKey); switch (trim($formKey)) { case "systems": return view('admin.settings.systems', $data); break; case "regional-currency-language": return view('admin.settings.regional-currency-language', $data); break; case "account": return view('admin.settings.account', $data); break; case "project": return view('admin.settings.project', $data); break; case "project-owner": return view('admin.settings.project-owner', $data); break; case "backer": return view('admin.settings.backer', $data); break; case "reward": return view('admin.settings.reward', $data); break; case "suspicious-words-detector": return view('admin.settings.suspicious-words-detector', $data); break; case "revenue": return view('admin.settings.revenue', $data); break; case "withdrawals": return view('admin.settings.withdrawals', $data); break; case "third-party-api": return view('admin.settings.api-credentials', $data); break; default: return view('admin.settings.systems', $data); } }
public function getData() { return Setting::all(); }
<?php use App\Setting; /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ $settings = Setting::all(); view()->share('settings', $settings); Route::get('/', function () { return redirect(route('home'), 301); }); Route::get('home', function () { return view('home'); })->name('home'); Route::get('rule', function () { return view('rule'); })->name('rule'); Route::group(['prefix' => 'contact', 'as' => 'contact::'], function () { Route::get('/', 'ContactController@show')->name('show'); // contact::show Route::post('/', 'ContactController@send')->name('send'); // contact::send }); Route::group(['prefix' => 'confess', 'as' => 'confess::'], function () {
public function index() { $settings = Setting::all(); return view('cms.settings.index', compact($settings)); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $settings = Setting::all(); return view('admin.settings.index', compact('settings')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $settings = Setting::all(); $settings = SettingRepository::settingsFormat($settings); return view('settings', compact('settings')); }
public function all() { $settings = Setting::all(); return response()->view('setting.all', ['settings' => $settings]); }