public function formdata()
 {
     if (Request::ajax()) {
         $type = Request::get('type');
         if ($type == 'run_it') {
             $data = Request::get('code');
             $myfile = fopen("code.php", "w+") or die("Unable to open file!");
             fwrite($myfile, '<?php ' . $data . ' ?>');
             fclose($myfile);
             //  print_r($data);
         } elseif ($type === 'store_it') {
             $code = Request::get('code');
             $pub = Carbon::now();
             $test = new user_code();
             $test->code = $code;
             $test->published_at = $pub;
             $test->save();
             //print_r($code);
         }
     }
     //ajax if closes here
 }