Basic from select auto in Laravel 8

Basic from select auto in Laravel 8

               

Basic from select auto in Laravel 8




Step 1: Install Laravel 8

First, install a new Laravel app just by running the below command in your terminal.

composer create-project --prefer-dist laravel/form_select

Step 2: Update Your Database Credentials

After that update your database credentials in your .env file which is located in your project root.

1. connection databases

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_db
DB_USERNAME=root
DB_PASSWORD=#your database password
2. for send mail when fogot password

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your email
MAIL_PASSWORD='your password email'
MAIL_ENCRYPTION=tls

Step 3: Make Migration

After adding the migration file now run the migrate command.

php artisan migrate

Step 4: Add in Home Page

Add the below code in your home.blade.php file.

Resources/Views/dashboard/dashbiard.blade.php


<div class="col-md-12 col-lg-6 col-xl-4 d-flex">
<div class="card flex-fill">
<div class="card-body">
<h4 class="card-title">Today Absent <span class="badge bg-inverse-danger ml-2">5</span></h4>
<div class="leave-info-box">
<div class="media align-items-center">
<a href="profile.html" class="avatar"><img alt="" src="assets/img/user.jpg"></a>
<div class="media-body">
<div class="text-sm my-0">Martin Lewis</div>
</div>
</div>
<div class="row align-items-center mt-3">
<div class="col-6">
<h6 class="mb-0">4 Sep 2019</h6> <span class="text-sm text-muted">Leave Date</span> </div>
<div class="col-6 text-right"> <span class="badge bg-inverse-danger">Pending</span> </div>
</div>
</div>
<div class="leave-info-box">
<div class="media align-items-center">
<a href="profile.html" class="avatar"><img alt="" src="assets/img/user.jpg"></a>
<div class="media-body">
<div class="text-sm my-0">Martin Lewis</div>
</div>
</div>
<div class="row align-items-center mt-3">
<div class="col-6">
<h6 class="mb-0">4 Sep 2019</h6> <span class="text-sm text-muted">Leave Date</span> </div>
<div class="col-6 text-right"> <span class="badge bg-inverse-success">Approved</span> </div>
</div>
</div>
<div class="load-more text-center"> <a class="text-dark" href="javascript:void(0);">Load More</a> </div>
</div>
</div>
</div>
</div>

Step 7: Create LoginController

php artisan make:controller LoginController

<?php namespace App\Http\Controllers\Auth; class LoginController extends Controller { /* |-------------------------------------------------------------------------- | Login Controller |-------------------------------------------------------------------------- | | This controller handles authenticating users for the application and | redirecting them to your home screen. The controller uses a trait

Step 9: Add Routes

In this step we create routes for Facebook login, add two routes in your web.php file.

app/routes/web.php

<?php

use Illuminate\Support\Facades\Route;

|--------------------------------------------------------------------------
|--------------------------------------------------------------------------
| Web Routes
| Here is where you can register web routes for your application. These
|
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// ----------------------------- main dashboard ------------------------------// Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); Route::get('em/dashboard', [App\Http\Controllers\HomeController::class, 'emDashboard'])->name('em/dashboard'); // -----------------------------login----------------------------------------//

Step 10: Run Development Server

After successfully updating all runs the development server just adds the below command in the terminal.

php artisan serve

After this go to the browser and check using the login page.

http://localhost/form_select/public/

Reactions

Post a Comment

0 Comments

close