public function index()
 {
     return View::make('display.show')->withMemories(Memory::orderBy('date_start', 'desc')->get());
 }
Example #2
0
 /**
  * Update info of memory.
  *
  * @param Request $request
  * @return mixed
  */
 public function postUpdateInfo(Request $request)
 {
     $memory = Memory::find($request->get('pk'));
     list($key, $value) = array($request->get('name'), $request->get('value'));
     if ($memory->update([$key => $value])) {
         return Response::json(['success' => 1]);
     }
 }
 /**
  * Get all unique tags.
  *
  * @return array
  */
 private function getAllTags()
 {
     $unique_tags = [];
     $memory_tags = Memory::all()->lists('tags');
     foreach ($memory_tags as $tag_item) {
         if ($tag_item) {
             $unique_tags = array_unique(array_merge($unique_tags, explode(',', $tag_item)));
         }
     }
     return $unique_tags;
 }