本文整理汇总了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]);
}
示例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()]);
}
示例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]);
}
示例4: clear
public function clear()
{
$settings = Setting::all();
$settings = Arr::dot($settings);
foreach ($settings as $key => $value) {
$this->forget($key);
}
$this->save();
}
示例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]);
}
示例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'));
}
示例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]);
}