messages implemented
This commit is contained in:
33
app/Http/Controllers/Dashboard/DashboardAwardsController.php
Normal file
33
app/Http/Controllers/Dashboard/DashboardAwardsController.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Artwork;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class DashboardAwardsController extends Controller
|
||||
{
|
||||
public function index(Request $request): View
|
||||
{
|
||||
$user = $request->user();
|
||||
|
||||
$artworks = Artwork::query()
|
||||
->where('user_id', (int) $user->id)
|
||||
->whereHas('awards')
|
||||
->with(['awardStat', 'stats', 'categories.contentType'])
|
||||
->orderByDesc(
|
||||
\App\Models\ArtworkAwardStat::select('score_total')
|
||||
->whereColumn('artwork_id', 'artworks.id')
|
||||
->limit(1)
|
||||
)
|
||||
->paginate(24)
|
||||
->withQueryString();
|
||||
|
||||
return view('dashboard.awards', [
|
||||
'artworks' => $artworks,
|
||||
'page_title' => 'My Awards – SkinBase',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user