Skip to content

Commit

Permalink
REFACTOR 🔨 Add Controller welcome page (#12)
Browse files Browse the repository at this point in the history
* Feature:Welcome page

* tweaks:adding  style changes to the welcome app

* tweaks:Changing  text for the welcome app

* tweaks:adding a controller for welcome blade
  • Loading branch information
reanbrenda authored Jan 26, 2024
1 parent 31d0f8f commit 26b86f8
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
14 changes: 14 additions & 0 deletions app/Http/Controllers/WebsiteController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class WebsiteController extends Controller
{
public function index()
{
return view('website');
}
}

42 changes: 42 additions & 0 deletions resources/views/website.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>{{ config('app.name', 'Laravel') }}</title>

<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
<!
<!-- Scripts -->
<script src="https://cdn.tailwindcss.com"></script>
{{--@vite(['resources/css/app.css', 'resources/js/app.js'])--}}
</head>
<body class="antialiased">
<div class="relative sm:flex sm:justify-center sm:items-center min-h-screen bg-dots-darker bg-center bg-gray-100 dark:bg-dots-lighter dark:bg-gray-900 selection:bg-red-500 selection:text-white">
@if (Route::has('login'))
<div class="sm:fixed sm:top-0 sm:right-0 p-6 text-right z-10">
@auth
<a href="{{ url('/dashboard') }}" class="font-semibold text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white focus:outline focus:outline-2 focus:rounded-sm focus:outline-red-500">Dashboard</a>
@else
<a href="{{ route('login') }}" class="font-semibold text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white focus:outline focus:outline-2 focus:rounded-sm focus:outline-red-500">Log in</a>

@if (Route::has('register'))
<a href="{{ route('register') }}" class="ml-4 font-semibold text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white focus:outline focus:outline-2 focus:rounded-sm focus:outline-red-500">Register</a>
@endif
@endauth
</div>
@endif


<div class="p-6 text-center text-gray-800 dark:text-white">
<h1 class="text-4xl font-bold mb-4">Welcome to Invoicing App</h1>
<p class="text-lg">Start managing your invoices now!</p>
</div>
</div>
</body>
</html>

5 changes: 2 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use App\Http\Controllers\ProfileController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\WebsiteController;

/*
|--------------------------------------------------------------------------
Expand All @@ -14,9 +15,7 @@
|
*/

Route::get('/', function () {
return view('welcome');
});
Route::get('/', [WebsiteController::class, 'index']);

Route::get('/dashboard', function () {
return view('dashboard');
Expand Down

0 comments on commit 26b86f8

Please sign in to comment.