title: My update, delete, create functions are not effecting database
body: <p>When I update my data or delete or create it does not work. The code does not give any kind of error, therefore it appears fine to me. When I try to update it, the updated data appears in the url but it does not appear in the database. This is the same for the delete function. Database is mysql. Below is my controller code</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use App\Company;
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Auth;
  
  class CompaniesController extends Controller
  {
      /**
       * Display a listing of the resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function index()
      {
          //
          $comapanies = Company::all();
          return view('companies.index',['companies'=&gt;$comapanies]);
      }
  
      /**
       * Show the form for creating a new resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function create()
      {
          return view('companies.create');
      }
  
      /**
       * Store a newly created resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @return \Illuminate\Http\Response
       */
      public function store(Request $request)
      {
           if(Auth::check()){
               $company = Company::create([
                      'name'=&gt;$request-&gt;input('name'),
                      'description'=&gt;$request-&gt;input('description'),
                      'user_id'=&gt;Auth::user()-&gt;id
                      //OR 'user_id'=&gt;$request-&gt;user()-&gt;id above 5.5 versions of laravel
              ]);
  
              if($company){
                  return redirect()-&gt;route('companies.show', ['company'=&gt;$company-&gt;id])
                          -&gt;with('success', 'Company Created Successfully');
              }
           }
  
           return back()-&gt;withInput()-&gt;with('errors', 'Error while creating company');
      }
  
      /**
       * Display the specified resource.
       *
       * @param  \App\Company  $company
       * @return \Illuminate\Http\Response
       */
      public function show(Company $company)
      {
           $company = Company::where('id', $company-&gt;id)-&gt;first();
          // $company = Company::find($company-&gt;id);
          return view('companies.show', ['company'=&gt;$company]);
      }
  
      /**
       * Show the form for editing the specified resource.
       *
       * @param  \App\Company  $company
       * @return \Illuminate\Http\Response
       */
      public function edit(Company $company)
      {
          $company = Company::find($company-&gt;id);
  
          return view('companies.edit', ['company'=&gt;$company]);
      }
  
      /**
       * Update the specified resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  \App\Company  $company
       * @return \Illuminate\Http\Response
       */
      public function update(Request $request, Company $company)
      {
          $companyupdate = Company::where('id', $company-&gt;id)-&gt;update([
                                                 'name'=&gt;$request-&gt;input('name'),
                                                 'description'=&gt;$request-&gt;input('description') 
                                              ]);
          if($companyupdate){
              return redirect()-&gt;route('companies.show',['company'=&gt;$company-&gt;id])
                              -&gt;with('success','Company Updated Successfully');
          }
           return back()-&gt;withInput()-&gt;with('errors', 'Updation failed');
  
      }
  
      /**
       * Remove the specified resource from storage.
       *
       * @param  \App\Company  $company
       * @return \Illuminate\Http\Response
       */
      public function destroy(Company $company)
      {
          $findcompany = Company::find($company-&gt;id);
          if($findcompany-&gt;delete()){
              return redirect()-&gt;route('companies.index')
                      -&gt;with('success', 'Company Deleted Successfully');
          }
          return back()-&gt;withInput()-&gt;with('errors', 'Company could not be deleted');
      }
  }
  
  </code></pre>
  
  <p>And this is the Edit view code </p>
  
  <pre><code>
  @extends('layouts.app')
  
  @section('content')
      &lt;div class="col-md-9 col-lg-9 col-sm-9 pull-left"&gt;
      &lt;!-- Jumbotron --&gt;
  
          &lt;div class="row col-lg-12 col-md-12 col-sm-12" style="background-color:white; margin:10px;"&gt;
              &lt;form mehtod="post" action="{{ route('companies.update', [$company-&gt;id]) }}"&gt;
                  {{ csrf_field() }}
                  &lt;input type="hidden" name="_method" value="put"&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;label for="company-name"&gt;Name&lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;input placeholder="Enter Name"
                          id="company-name"
                          required
                          name="name"
                          spellcheck="false"
                          class="form-control"
                          value="{{$company-&gt;name}}"
                      /&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label for="company-content"&gt;Description&lt;/label&gt;
                      &lt;textarea placeholder="Enter Description"
                          id="company-content"
                          required
                          name="description"
                          spellcheck="false"
                          class="form-control autosize-target text-left"
                          rows="5"&gt; 
                          {{ $company-&gt;description }}&lt;/textarea&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                      &lt;input type="submit" class="btn btn-primary" value="Submit"/&gt;
                  &lt;/div&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="col-sm-3 col-md-3 col-lg-3 pull-right"&gt;
           &lt;!-- &lt;div class="sidebar-module sidebar-module-inset"&gt;
          &lt;h4&gt;About&lt;/h4&gt;
              &lt;p&gt;Etiam porta &lt;em&gt;sem malesuada magna&lt;/em&gt; mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur.&lt;/p&gt;
            &lt;/div&gt;--&gt;
            &lt;div class="sidebar-module"&gt;
              &lt;h4&gt;Actions&lt;/h4&gt;
              &lt;ol class="list-unstyled"&gt;
                &lt;li&gt;&lt;a href="/companies/{{ $company-&gt;id }}"&gt;View Company&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="/companies"&gt;All Companies&lt;/a&gt;&lt;/li&gt;
              &lt;/ol&gt;
            &lt;/div&gt;
            &lt;!--&lt;div class="sidebar-module"&gt;
              &lt;h4&gt;Members&lt;/h4&gt;
              &lt;ol class="list-unstyled"&gt;
                &lt;li&gt;&lt;a href="#"&gt;March 2014&lt;/a&gt;&lt;/li&gt;
              &lt;/ol&gt;
            &lt;/div&gt;--&gt;
      &lt;/div&gt;
      @endsection
  
  </code></pre>
  
  <p>And this is my company model</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Company extends Model
  {
      Protected $fillable = [
          'name',
          'description',
          'user_id',
      ];
  
      public function users(){
          return $this-&gt;belongsTo('App\User');
      }
  
      public function projects(){
          return $this-&gt;hasmany('App\Project'); 
      }
  }
  
  
  </code></pre>