当前位置: 首页>>代码示例>>PHP>>正文


PHP Setting::all方法代码示例

本文整理汇总了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]);
 }
开发者ID:gitstashgithub,项目名称:rating,代码行数:25,代码来源:LessonController.php

示例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]);
     }
 }
开发者ID:labkod,项目名称:real-estate,代码行数:12,代码来源:AppServiceProvider.php

示例3: edit

 public function edit()
 {
     $settings = [];
     foreach (Setting::all() as $setting) {
         $settings[$setting->name] = $setting->value;
     }
     return view("realestateadmin::settings.edit", ["settings" => $settings]);
 }
开发者ID:labkod,项目名称:real-estate,代码行数:8,代码来源:SettingsController.php

示例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);
 }
开发者ID:udayc,项目名称:travel,代码行数:13,代码来源:AppServiceProvider.php

示例5: allSetting

 public static function allSetting()
 {
     $settingobj = Setting::all();
     $return = array();
     foreach ($settingobj as $o) {
         $return[$o->name] = $o->value;
     }
     return $return;
 }
开发者ID:sordev,项目名称:bootup,代码行数:9,代码来源:Setting.php

示例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);
 }
开发者ID:lamadipen,项目名称:tracker,代码行数:14,代码来源:SettingController.php

示例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;
     });
 }
开发者ID:kpaxer,项目名称:laravel-blog,代码行数:13,代码来源:Setting.php

示例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');
 }
开发者ID:Volix,项目名称:portfolio,代码行数:22,代码来源:viewComposers.php

示例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');
 }
开发者ID:namcoder,项目名称:Topshare,代码行数:17,代码来源:SettingsController.php

示例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);
     }
 }
开发者ID:udayc,项目名称:travel,代码行数:51,代码来源:SettingsController.php

示例11: getData

 public function getData()
 {
     return Setting::all();
 }
开发者ID:tianyirenjian,项目名称:laravel-blog,代码行数:4,代码来源:SettingController.php

示例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 () {
开发者ID:h2dvnnet,项目名称:cfs,代码行数:31,代码来源:routes.php

示例13: index

 public function index()
 {
     $settings = Setting::all();
     return view('cms.settings.index', compact($settings));
 }
开发者ID:BobbyHoltzner,项目名称:BH2016,代码行数:5,代码来源:SettingController.php

示例14: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $settings = Setting::all();
     return view('admin.settings.index', compact('settings'));
 }
开发者ID:kpaxer,项目名称:laravel-blog,代码行数:10,代码来源:SettingsController.php

示例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'));
 }
开发者ID:rodrigoueda,项目名称:tcc-fruto-urbano,代码行数:11,代码来源:SettingController.php


注:本文中的app\Setting::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。