/**
  * Store a newly created ad bloxk in storage.
  *
  * @return \Illuminate\Http\Response
  */
 public function store()
 {
     //Create the validator to process input for validation.
     $input = $this->purifier->clean(Input::except('_token'));
     $validator = Validator::make($input, AdBlockValidator::validationRules());
     if ($validator->fails()) {
         return Redirect::to('/admin/ad_block_config')->withErrors($validator)->withInput($input);
     }
     $adBlock = new AdBlock();
     $adBlock->fill($input);
     $adBlock->save();
     Session::flash('success_message_add', 'The Ad Block has successfully been created and stored!');
     return Redirect::to('/admin/ad_block_config');
 }
 /**
  * Store a newly created main meta in storage.
  *
  * @return Response
  */
 public function store()
 {
     //Create the validator to process input for validation.
     $input = Input::except('_token', 'page_main_content');
     $mainContent = $this->purifier->clean(Input::get('page_main_content'));
     $input['page_main_content'] = $mainContent;
     $validator = Validator::make($input, MainMetaValidator::validationRules());
     if ($validator->fails()) {
         return Redirect::to('/admin/main_meta')->withErrors($validator)->withInput($input);
     }
     $mainMeta = new MainMeta();
     $mainMeta->fill($input);
     $mainMeta->save();
     Session::flash('success_message_add', 'The main meta has successfully been created and stored!');
     return Redirect::to('/admin/main_meta/');
 }
示例#3
0
 /**
  * Clean the input text and return it clean
  *
  * @param  string  $dirtyText
  * @param  array  $configuration
  *
  * @return string
  */
 public function clean($dirtyText, $configuration = 'default')
 {
     return $this->purifier->clean($dirtyText, $configuration);
 }