Ignore:
Timestamp:
02/26/21 18:14:28 (4 years ago)
Author:
Berat Kjufliju <kufliju@…>
Branches:
master
Children:
7ed1069
Parents:
f457265
Message:

Added companies delete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/Http/Controllers/Dashboard/CompaniesController.php

    rf457265 rff9da8b  
    33namespace App\Http\Controllers\Dashboard;
    44
     5use App\Helpers\Alert;
    56use App\Models\Company;
    67use Illuminate\Http\Request;
     
    2930        ]);
    3031    }
     32
     33    public function destroy($id)
     34    {
     35        $company = Company::findOrFail($id);
     36        $companyName = $company->name;
     37        $company->delete();
     38
     39        Alert::flash($companyName . " deleted successfully");
     40
     41        return redirect()->route("dashboard.companies.index");
     42    }
    3143}
Note: See TracChangeset for help on using the changeset viewer.