-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
2,319 additions
and
2,767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Models\Library; | ||
|
||
class HomepageController extends Controller | ||
{ | ||
public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\View|\Illuminate\Contracts\Foundation\Application | ||
{ | ||
// Fetch the latest edited libraries from the database | ||
$latest_changes = Library::orderBy('last_edited', 'desc')->take(5)->get(); | ||
|
||
// Pass the data to the view | ||
return view('landing_page', compact('latest_changes')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App\View\Components; | ||
|
||
use Closure; | ||
use Illuminate\Contracts\View\View; | ||
use Illuminate\View\Component; | ||
|
||
class Latest extends Component | ||
{ | ||
public mixed $latestChanges; | ||
|
||
/** | ||
* Create a new component instance. | ||
*/ | ||
public function __construct($latestChanges) | ||
{ | ||
$this->latestChanges = $latestChanges; | ||
} | ||
|
||
/** | ||
* Get the view / contents that represent the component. | ||
*/ | ||
public function render(): View|Closure|string | ||
{ | ||
return view('components.latest', ['latest_changes' => $this->latestChanges]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.