Changeset ff9da8b
- Timestamp:
- 02/26/21 18:14:28 (4 years ago)
- Branches:
- master
- Children:
- 7ed1069
- Parents:
- f457265
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/CompaniesController.php
rf457265 rff9da8b 3 3 namespace App\Http\Controllers\Dashboard; 4 4 5 use App\Helpers\Alert; 5 6 use App\Models\Company; 6 7 use Illuminate\Http\Request; … … 29 30 ]); 30 31 } 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 } 31 43 } -
database/migrations/2019_10_12_000000_create_users_table.php
rf457265 rff9da8b 25 25 $table->string('mobile_number')->unique(); 26 26 $table->integer('company_id')->unsigned()->nullable(); 27 $table->foreign("company_id")->references("id")->on("companies") ;27 $table->foreign("company_id")->references("id")->on("companies")->onDelete("cascade"); 28 28 $table->integer('role_id')->unsigned(); 29 29 $table->foreign("role_id")->references("id")->on("roles"); -
resources/views/dashboard/companies/index.blade.php
rf457265 rff9da8b 50 50 <a href="{{ route("dashboard.companies.create-admin", ["id" => $company->id]) }}" class="actionLink dropdown-item" style="cursor: pointer;"><i class="dropdown-icon fe fe-user"></i> Create admin user</a> 51 51 @endif 52 <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard. tags.destroy", ["id" => $company->id]) }}" data-method="delete"><i class="dropdown-icon fe fe-trash-2 text-danger"></i> Delete </a>52 <a href="javascript:void(0)" class="actionLink dropdown-item" style="cursor: pointer;" data-action="{{ route("dashboard.companies.destroy", ["id" => $company->id]) }}" data-method="delete"><i class="dropdown-icon fe fe-trash-2 text-danger"></i> Delete </a> 53 53 </div> 54 54 </div>
Note:
See TracChangeset
for help on using the changeset viewer.