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


PHP Setting::all方法代码示例

本文整理汇总了PHP中app\models\Setting::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::all方法的具体用法?PHP Setting::all怎么用?PHP Setting::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Setting的用法示例。


在下文中一共展示了Setting::all方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: home

 protected function home()
 {
     $bigevent = [];
     $settings = Setting::all();
     foreach ($settings as $setting) {
         $arr = ['name' => $setting['name'], 'value' => $setting['value']];
         if (substr($setting['key'], 0, 3) === "be-") {
             $bigevent[$setting['key']] = $arr;
         } else {
             $other[$setting['key']] = $arr;
         }
     }
     //BEAUCOUPS D'APPELS A LA BDD, CERTES EN HAUT C'EST PAS FORCEMENT MIEUX, de tout facon faudra faire un systeme de "event mis en avant" en faisant les events.
     /*
     	$about = Setting::where('key', 'about')->first();
     	$bigevent["main-photo"] = Setting::where('key', 'be-main-photo')->first()->value;
     	$bigevent["bg-photo"] = Setting::where('key', 'be-bg-photo')->first()->value;
     	$bigevent["title"] = Setting::where('key', 'be-title')->first()->value;
     	$bigevent["label"] = Setting::where('key', 'be-label')->first()->value;
     	$bigevent["description"] = Setting::where('key', 'be-description')->first()->value;
     	$bigevent["link"] = Setting::where('key', 'be-link')->first()->value;
     	$agenda = Setting::where('key', 'agenda')->first()->value;
     	$posts = ClubPost::all();
     	return view('home')->with([
     		'about' => $about->value,
     		'posts' => $posts,
     		'bigevent' => $bigevent,
     		'agenda' => $agenda]);
     */
     $posts = ClubPost::all();
     return view('home')->with(['posts' => $posts, 'bigevent' => $bigevent, 'other' => $other]);
 }
开发者ID:bde42,项目名称:website_v2_laravel,代码行数:32,代码来源:BaseController.php

示例2: index

 /**
  * Get a set of application data.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function index()
 {
     $playlists = Playlist::byCurrentUser()->orderBy('name')->with('songs')->get()->toArray();
     // We don't need full song data, just ID's
     foreach ($playlists as &$playlist) {
         $playlist['songs'] = array_pluck($playlist['songs'], 'id');
     }
     return response()->json(['artists' => Artist::orderBy('name')->with('albums', with('albums.songs'))->get(), 'settings' => Setting::all()->lists('value', 'key'), 'playlists' => $playlists, 'interactions' => Interaction::byCurrentUser()->get(), 'users' => auth()->user()->is_admin ? User::all() : [], 'user' => auth()->user()]);
 }
开发者ID:Holdlen2DH,项目名称:koel,代码行数:14,代码来源:DataController.php

示例3: index

 public function index()
 {
     $featured = Featured::where('visible', '=', 1)->get();
     $settingsData = Setting::all();
     foreach ($settingsData as $setting) {
         $settings[$setting->key] = $setting->value;
     }
     return view('pages/index', ['featured' => $featured], ['settings' => $settings]);
 }
开发者ID:ambarsetyawan,项目名称:laravel-blog-2,代码行数:9,代码来源:PageController.php

示例4: clear

 public function clear()
 {
     $settings = Setting::all();
     $settings = Arr::dot($settings);
     foreach ($settings as $key => $value) {
         $this->forget($key);
     }
     $this->save();
 }
开发者ID:sroutier,项目名称:laravel-5.1-enterprise-starter-kit,代码行数:9,代码来源:Setting.php

示例5: index

 /**
  * Get a set of application data.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function index()
 {
     $playlists = Playlist::byCurrentUser()->orderBy('name')->with('songs')->get()->toArray();
     // We don't need full song data, just ID's
     foreach ($playlists as &$playlist) {
         $playlist['songs'] = array_pluck($playlist['songs'], 'id');
     }
     return response()->json(['artists' => Artist::orderBy('name')->with('albums', with('albums.songs'))->get(), 'settings' => Setting::all()->lists('value', 'key'), 'playlists' => $playlists, 'interactions' => Interaction::byCurrentUser()->get(), 'users' => auth()->user()->is_admin ? User::all() : [], 'currentUser' => auth()->user(), 'useLastfm' => env('LASTFM_API_KEY') && env('LASTFM_API_SECRET'), 'currentVersion' => Application::VERSION, 'latestVersion' => auth()->user()->is_admin ? app()->getLatestVersion() : Application::VERSION]);
 }
开发者ID:lexxksb,项目名称:koel,代码行数:14,代码来源:DataController.php

示例6: getIndex

 /**
  * Return a view that shows some of the key settings.
  *
  * @author [A. Gianotto] [<snipe@snipe.net>]
  * @since [v1.0]
  * @return View
  */
 public function getIndex()
 {
     // Grab all the settings
     $settings = Setting::all();
     // Show the page
     return View::make('settings/index', compact('settings'));
 }
开发者ID:stijni,项目名称:snipe-it,代码行数:14,代码来源:SettingsController.php

示例7: edit

 /**
  * Display a listing of the settings in the dashboard.
  *
  * @return Response
  */
 public function edit()
 {
     $settings = Setting::all();
     return view('settings.edit', ['settings' => $settings]);
 }
开发者ID:bde42,项目名称:website_v2_laravel,代码行数:10,代码来源:SettingsController.php


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