Esempio n. 1
0
 /**
  * Returns the Module Admin View.
  *
  * Determines if a view exists by:
  * Looking for $this->view
  * Then looks for  'admin.modulename.index',
  * Then looks for  'admin.modulename',
  * Then defaults to 
  * 
  * @return string
  */
 public function getView()
 {
     if (view()->exists($this->view)) {
         return $this->view;
     }
     if (view()->exists('admin.' . $this->urlPrefix() . '.index')) {
         return 'admin.' . $this->urlPrefix() . '.index';
     }
     if (view()->exists('admin.' . $this->urlPrefix())) {
         return 'admin.' . $this->urlPrefix();
     }
     if (view()->exists('flare::' . $this->view)) {
         return 'flare::' . $this->view;
     }
     return parent::getView();
 }
Esempio n. 2
0
 /**
  * Returns the Route Paramets.
  * 
  * @return array
  */
 public function routeParameters()
 {
     return array_merge(parent::routeParameters(), ['model' => $this->managedModel]);
 }
Esempio n. 3
0
 /**
  * Returns an instance of the Admin.
  * 
  * @return Admin
  */
 public static function getAdminInstance()
 {
     if (!($requested = Admin::getRequested())) {
         return;
     }
     return new $requested();
 }