mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update AdminController, add new methods
This commit is contained in:
parent
8de99876e8
commit
43c9c264ef
1 changed files with 35 additions and 1 deletions
|
@ -3,8 +3,42 @@
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use App\{Comment, Like, Media, Profile, Status, User};
|
||||||
|
|
||||||
class AdminController extends Controller
|
class AdminController extends Controller
|
||||||
{
|
{
|
||||||
//
|
public function __construct()
|
||||||
|
{
|
||||||
|
return $this->middleware('admin');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function home()
|
||||||
|
{
|
||||||
|
return view('admin.home');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function users(Request $request)
|
||||||
|
{
|
||||||
|
$users = User::orderBy('id', 'desc')->paginate(10);
|
||||||
|
return view('admin.users.home', compact('users'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function statuses(Request $request)
|
||||||
|
{
|
||||||
|
$statuses = Status::orderBy('id', 'desc')->paginate(10);
|
||||||
|
return view('admin.statuses.home', compact('statuses'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showStatus(Request $request, $id)
|
||||||
|
{
|
||||||
|
$status = Status::findOrFail($id);
|
||||||
|
return view('admin.statuses.show', compact('status'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function media(Request $request)
|
||||||
|
{
|
||||||
|
$media = Status::whereHas('media')->orderby('id', 'desc')->paginate(12);
|
||||||
|
return view('admin.media.home', compact('media'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue