26 lines
540 B
PHP
26 lines
540 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Http\Controllers;
|
||
|
|
|
||
|
|
use App\Models\Project;
|
||
|
|
use Illuminate\View\View;
|
||
|
|
|
||
|
|
class ProjectController extends Controller
|
||
|
|
{
|
||
|
|
public function index(): View
|
||
|
|
{
|
||
|
|
$projects = Project::query()
|
||
|
|
->orderByDesc('is_featured')
|
||
|
|
->orderBy('sort_order')
|
||
|
|
->orderByDesc('created_at')
|
||
|
|
->get();
|
||
|
|
|
||
|
|
return view('projects.index', compact('projects'));
|
||
|
|
}
|
||
|
|
|
||
|
|
public function show(Project $project): View
|
||
|
|
{
|
||
|
|
return view('projects.show', compact('project'));
|
||
|
|
}
|
||
|
|
}
|