w3resource

Laravel (5.7) Frontend Scaffolding

This tutorial discusses how to install Laravel Application and frontend scaffolding.

Install Laravel Application

First step open your terminal and type the next command:

laravel new laravel-scaffold

Install Laravel Application.
Install Laravel Authentication

Enter to folder project an run the next command:

cd laravel-scaffold
php artisan make:auth
Install Laravel Application - 2.

Create DB

Run the next commands:

mysql -u{user} -p{password}
mysql> create database laravel-scaffold;

Configure DB

Edit .env file
nano .env
Into .env file fill the data base vars
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel-scaffold
DB_USERNAME=user
DB_PASSWORD=password

Create tables

Run the next command:

php artisan migrate
Install Laravel Application - 3.

enerate User Table Seed

Create UsersTableSeeder.php with the next command:

php artisan make:seeder UsersTableSeeder

Into UsersTableSeeder.php file write the next code:

<?php

use Illuminate\Database\Seeder;

class UsersTableSeeder extends Seeder
{
   /**
    * Run the database seeds.
    *
    * @return void
    */
   public function run()
   {
       factory(App\User::class, 50)->create();
   }
}

Add UsersTableSeeder.php seeder to DatabaseSeeder.php

<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
   /**
    * Seed the application's database.
    *
    * @return void
    */
   public function run()
   {
       $this->call(UsersTableSeeder::class);
   }
}

Run seed

php artisan db:seed
Install Laravel Application - 4.
Install Laravel Application - 5.

Install Vuejs Frontend

Run the next command:

npm install

Add Browsersync Reloading into webpack.mix.js file

mix.js('resources/js/app.js', 'public/js')
  .sass('resources/sass/app.scss', 'public/css')
  .browserSync('laravel-scaffold.test');

Finally Compiling Assets (Laravel Mix) with the next commans:

npm run dev

or

npm run watch

Now we have the next screen when enter the

http://localhost:3000 route in browser

Install Laravel Application - 6.

http://localhost:3000/login

Install Laravel Application - 7.

http://localhost:3000/register

Install Laravel Application - 8.

http://localhost:3000/password/reset

Install Laravel Application - 9.

Previous: Laravel (5.7) Compiling Assets
Next: Laravel (5.7) Authentication



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/laravel/frontend-scaffolding.php