Пример #1
0
 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
0
 /**
  * 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()]);
 }
 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]);
 }
 public function clear()
 {
     $settings = Setting::all();
     $settings = Arr::dot($settings);
     foreach ($settings as $key => $value) {
         $this->forget($key);
     }
     $this->save();
 }
Пример #5
0
 /**
  * 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
0
 /**
  * Return a view that shows some of the key settings.
  *
  * @author [A. Gianotto] [<*****@*****.**>]
  * @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'));
 }
 /**
  * Display a listing of the settings in the dashboard.
  *
  * @return Response
  */
 public function edit()
 {
     $settings = Setting::all();
     return view('settings.edit', ['settings' => $settings]);
 }