當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。