Skip to content

Commit

Permalink
Drop old and git-related Group stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
JanOppolzer committed Nov 22, 2024
1 parent a33ed11 commit 876e29c
Show file tree
Hide file tree
Showing 19 changed files with 6 additions and 999 deletions.
63 changes: 1 addition & 62 deletions app/Http/Controllers/GroupController.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\UpdateGroup;
use App\Models\Group;
use App\Models\User;
use App\Notifications\GroupDeleted;
use App\Notifications\GroupUpdated;
use App\Traits\GitTrait;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Storage;

class GroupController extends Controller
{
use GitTrait;

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

return view('groups.show', [
'group' => $group,
]);
}

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

$old_group = $group->tagfile;
$group->update($request->validated());

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

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

return redirect()
->route('groups.show', $group)
->with('status', __('groups.updated', ['name' => $old_group]));
}

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

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

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

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

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Loading

0 comments on commit 876e29c

Please sign in to comment.