/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $types = Element::all();
     return view('admin.element.base', ['types' => $types]);
 }
Esempio n. 2
0
 /**
  * Display a listing of the resource as a component.
  *
  * @return \Illuminate\Http\Response
  */
 public function indexComponent()
 {
     $data['elements'] = Element::all();
     return \View::make('elements.indexcomponent')->with($data);
 }
Esempio n. 3
0
 /**
  * Get Elements that are not linked to the Layout ID provided.
  *
  * @param  \Layout ID
  */
 public function getUnlinkedElements($id)
 {
     //Find all elements related to a Layout
     $linkedElements = LayoutsController::getElements($id);
     //Get the elements that are related to id
     $linkedElementsId = $linkedElements->lists('id');
     if (count($linkedElementsId) == 0) {
         //If there is no related elements, return all available elements.
         return Element::all();
     } else {
         //If there is related elements, find the ones that are not related
         return Element::whereNotIn('id', $linkedElementsId)->get();
     }
 }
 public function compose(View $view)
 {
     $examList = array('' => 'Select a exam date') + DB::table('sittings')->select(DB::raw('concat (month," / ",year) as sitting,id'))->lists('sitting', 'id');
     $view->with('methodList', \App\Method::all())->with('levelList', \App\Level::all())->with('paperList', \App\Paper::all())->with('centreList', \App\Centre::all())->with('elementList', \App\Element::all())->with('examList', $examList);
 }