Skip to content

Commit

Permalink
Drop old and git-related Category stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
JanOppolzer committed Nov 22, 2024
1 parent 8a4ae4b commit 9c7b1ad
Show file tree
Hide file tree
Showing 22 changed files with 5 additions and 1,208 deletions.
63 changes: 1 addition & 62 deletions app/Http/Controllers/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@

namespace App\Http\Controllers;

use App\Http\Requests\UpdateCategory;
use App\Models\Category;
use App\Models\User;
use App\Notifications\CategoryDeleted;
use App\Notifications\CategoryUpdated;
use App\Traits\GitTrait;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Storage;

class CategoryController extends Controller
{
use GitTrait;

/**
* Display a listing of the resource.
*
Expand All @@ -36,58 +27,6 @@ public function show(Category $category)
{
$this->authorize('do-everything');

return view('categories.show', [
'category' => $category,
]);
}

/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function update(UpdateCategory $request, Category $category)
{
$this->authorize('do-everything');

$old_category = $category->tagfile;
$category->update($request->validated());

if (! $category->wasChanged()) {
return redirect()
->route('categories.show', $category);
}

Notification::send(User::activeAdmins()->select('id', 'email')->get(), new CategoryUpdated($category));

return redirect()
->route('categories.show', $category)
->with('status', __('categories.updated', ['name' => $old_category]));
}

/**
* Remove the specified resource from storage.
*
* @return \Illuminate\Http\Response
*/
public function destroy(Category $category)
{
$this->authorize('do-everything');

if ($category->entities->count() !== 0) {
return redirect()
->route('categories.show', $category)
->with('status', __('categories.delete_empty'))
->with('color', 'red');
}

$name = $category->tagfile;
$category->delete();

Notification::send(User::activeAdmins()->select('id', 'email')->get(), new CategoryDeleted($name));

return redirect('categories')
->with('status', __('categories.deleted', ['name' => $name]));
return view('categories.show', compact('category'));
}
}
131 changes: 0 additions & 131 deletions app/Http/Controllers/CategoryManagementController.php

This file was deleted.

31 changes: 0 additions & 31 deletions app/Http/Requests/StoreCategory.php

This file was deleted.

36 changes: 0 additions & 36 deletions app/Http/Requests/UpdateCategory.php

This file was deleted.

67 changes: 0 additions & 67 deletions app/Jobs/Old_Jobs/Old_GitAddCategory.php

This file was deleted.

Loading

0 comments on commit 9c7b1ad

Please sign in to comment.