/app/Laravel/Controllers/Backoffice/QuestionController.php

https://bitbucket.org/cityserv/techreportph · PHP · 44 lines · 20 code · 8 blank · 16 comment · 0 complexity · 4d418481b3e50690879a454e48720405 MD5 · raw file

  1. <?php namespace App\Laravel\Controllers\Backoffice;
  2. /**
  3. *
  4. * Models used for this controller
  5. */
  6. use App\Laravel\Models\Question;
  7. /**
  8. *
  9. * Requests used for validating inputs
  10. */
  11. use App\Laravel\Requests\Backoffice\AdvertisementRequest;
  12. /**
  13. *
  14. * Classes used for this controller
  15. */
  16. use App\Http\Requests\Request;
  17. use Input, Helper, Carbon, Session, Str, File, Image, ImageUploader;
  18. class QuestionController extends Controller{
  19. /**
  20. *
  21. * @var Array $data
  22. */
  23. protected $data;
  24. public function __construct () {
  25. parent::__construct();
  26. $view = Input::get('view','table');
  27. array_merge($this->data, parent::get_data());
  28. $this->data['page_title'] = "Question";
  29. $this->data['page_description'] = "This is the general information about ".$this->data['page_title'].".";
  30. $this->data['route_file'] = "question";
  31. }
  32. public function index () {
  33. $this->data['question'] = Question::orderBy('created_at',"DESC")->get();
  34. return view('backoffice.'.$this->data['route_file'].'.index',$this->data);
  35. }
  36. }