Exemple #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     if (Auth::hasPermission('create')) {
         $attributes = $this->filterAndValidate();
         $section = $this->sections->create($attributes['title'], $attributes['alias'], $attributes['icon'], $attributes['is_fertile'], $attributes['is_roleable']);
         if (Input::has('parent') && Input::get('parent') > 0) {
             $section->parent()->associate($this->sections->find(Input::get('parent')))->save();
         }
     }
 }