本文整理汇总了PHP中app\Setting::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::all方法的具体用法?PHP Setting::all怎么用?PHP Setting::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Setting
的用法示例。
在下文中一共展示了Setting::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
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]);
}
示例2: boot
/**
* 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]);
}
}
示例3: edit
public function edit()
{
$settings = [];
foreach (Setting::all() as $setting) {
$settings[$setting->name] = $setting->value;
}
return view("realestateadmin::settings.edit", ["settings" => $settings]);
}
示例4: boot
/**
* 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);
}
示例5: allSetting
public static function allSetting()
{
$settingobj = Setting::all();
$return = array();
foreach ($settingobj as $o) {
$return[$o->name] = $o->value;
}
return $return;
}
示例6: index
/**
* 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);
}
示例7: getSettingsArr
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;
});
}
示例8: register
/**
* 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');
}
示例9: index
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');
}
示例10: show
/**
* 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);
}
}
示例11: getData
public function getData()
{
return Setting::all();
}
示例12: function
<?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 () {
示例13: index
public function index()
{
$settings = Setting::all();
return view('cms.settings.index', compact($settings));
}
示例14: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$settings = Setting::all();
return view('admin.settings.index', compact('settings'));
}
示例15: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$settings = Setting::all();
$settings = SettingRepository::settingsFormat($settings);
return view('settings', compact('settings'));
}