Laravel 5.2 storing database in DB table
<p>Im new in Laravel so can anyone help me
I want to store the data in my database, i dont know if what i'm doing is right. Sorry for being a noob.</p>

<p>Here is my PaypalController</p>

<pre><code>         &lt;?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Input;

use Illuminate\Support\Facades\Validator;

use Illuminate\Support\Facades\Redirect;

use Illuminate\Support\Facades\Request;

use Illuminate\Support\Facades\Session;

use Illuminate\Support\Facades\Auth;

use Illuminate\Support\Facades\DB;

use Illuminate\Mail\Mailer;

use App\Maintenance;

use App\Time_tracker;


class PaypalController extends Controller {

 /**
 * Create a new controller instance.
 *
 * @return void
 */
public function __construct()
{
    $this-&gt;middleware('auth');
}

/**
 * Show the application dashboard.
 *
 * @return \Illuminate\Http\Response
 */

 public function index() {

 return view('paypal'); 

 }

 public function success() {
     $price = \Session::get('value_price');
 $value = $price;
 if($value == '465'){

         $paid = 'paid';
     DB::table('users')-&gt;insert([
     ['user_id' =&gt; $id],
     ['paid' =&gt; $paid]
     ]);
     $user_id = Auth::user()-&gt;id;
     $user = maintenance::find($id);
     $current_hour = $nerd-&gt;hour;
     $purchase_time = $purchase_time + 15;
     $current_hour = $current_hour + $purchase_time;

     $user = new Time_tracker;
         $user-&gt;hoursT = $current_hour;
     $user-&gt;paid = $paid;
         $user-&gt;date = $status;
         $user-&gt;save();




 }elseif($value == '700'){

    //   $paid = paid;
     DB::table('users')-&gt;insert([
     ['user_id' =&gt; $id],
     ['paid' =&gt; $paid]
     ]);
     $user_id = Auth::user()-&gt;id;
     $user = maintenance::find($id);
     $current_hour = $nerd-&gt;hour;
     $purchase_time = $purchase_time + 25;
     $current_hour = $current_hour + $purchase_time;

     $user = new Time_tracker;
         $user-&gt;hoursT = $current_hour;
     $user-&gt;paid = $paid;
         $user-&gt;date = $status;
         $user-&gt;save();


  }elseif($value == '1300'){

         $paid = paid;
     DB::table('users')-&gt;insert([
     ['user_id' =&gt; $id],
     ['paid' =&gt; $paid]
     ]);
     $user_id = Auth::user()-&gt;id;
     $user = maintenance::find($id);
     $current_hour = $nerd-&gt;hour;
     $purchase_time = $purchase_time + 50;
     $current_hour = $current_hour + $purchase_time;

     $user = new Time_tracker;
         $user-&gt;hoursT = $current_hour;
     $user-&gt;paid = $paid;
         $user-&gt;date = $status;
         $user-&gt;save();



   }


   return view('success');  

   }


   public function failed() {

     return view('failed'); 

 }


}
</code></pre>

<p>Here is my MaintenanceformController</p>

<pre><code>    &lt;?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Input;

use Illuminate\Support\Facades\Validator;

use Illuminate\Support\Facades\Redirect;

use Illuminate\Support\Facades\Request;

use Illuminate\Support\Facades\Session;

use Illuminate\Support\Facades\DB;

use Illuminate\Support\Facades\Auth;

use Illuminate\Mail\Mailer;

use App\Maintenance;

use App\Apply;

class MaintenanceformController extends Controller { 

  public function index() {
     $TownResults = DB::table('apply')-&gt;where('user', '=', Auth::user()-&gt;id)-&gt;get(); 
     return view('maintenanceform')-&gt;with('town_list', $TownResults);
  }

  public function multiple_upload() {

     $files = Input::file('images');
     $tasknumber = Input::get('tasknumber');
     $ordernumber = Input::get('ordernumber');
     $status = Input::get('status');
     $directions = Input::get('directions');
     $comments = Input::get('comments');
         $user_id = Auth::user()-&gt;id;
         $designation = Input::get('designation');

    $file_count = count($files);

    // start count how many uploaded

    $uploadcount = 0;


    foreach($files as $file) {

      $rules = array('file' =&gt; 'required'); //'required|mimes:png,gif,jpeg,txt,pdf,doc'

      $validator = Validator::make(array('file'=&gt; $file), $rules);

      if($validator-&gt;passes()){

        $destinationPath = 'uploads/'.$tasknumber.'';

        $filename = ''.$tasknumber.'_'.$file-&gt;getClientOriginalName().'';

        $upload_success = $file-&gt;move($destinationPath, $filename);

        $uploadcount ++;



      }

    }

    $user = new Maintenance;

    $user-&gt;tasknumber = $tasknumber;
    $user-&gt;ordernumber = $ordernumber;
    $user-&gt;status = $status;
    $user-&gt;directions = $directions;
    $user-&gt;comments = $comments;
    $user-&gt;user_id = $user_id;
    $user-&gt;designation = $designation;

    $user-&gt;save();



   if($uploadcount == $file_count){

      Session::flash('success', 'Upload successfully'); 

      return Redirect::to('maintenance');

    } 

    else {

      return Redirect::to('maintenance')-&gt;withInput()-&gt;withErrors($validator);

    }


  }
}
</code></pre>

<p>I want to save the user_id, hoursT, paid, and purchase_time in DB table. Can anyone please help me. :)</p>