Coder Social home page Coder Social logo

sandbox-laravel-by-flywheel's Introduction

Sandbox Laravel

This is sandbox Laravel development by Local by Flywheel.

Installation

Launch Local by Flywheel, and Add Local Site (Add + button).

  • Site name: Laravel
  • Environment: Preffered
  • WordPress username and password: Anything(delete later)

Enable SSL on the dashboard.

  • Local Sites > Laravel > SSL > Certificate > TRUST

Launch terminal, and download Laravel Installer.

$ composer global require laravel/installer

Set Laravel command path to environment variable.

$ vi ~/.bash_profile
export PATH=$PATH:$HOME/.composer/vendor/bin

$ source ~/.bash_profile

Delete app directory of local site.

$ cd ~/Local\ Sites/laravel/
$ rm -rf app

Install Laravel.

$ laravel new app

The Laravel public directory will be installed at the WordPress DocumentRoot location, as follows:

$ ls app
README.md		bootstrap		config			package.json		resources		storage			webpack.mix.js
app			composer.json		database		phpunit.xml		routes			tests
artisan			composer.lock		package-lock.json	public			server.php		vendor

Restart the site on the dashboard.

  • Local Sites > Laravel > STOP SITE and START SITE

Visit https://laravel.local in your browser, you will see Laravel welcome page.

DB Settings

Launch Adminer on the dashboard, delete all tables with the name wp_.

  • Local Sites > Laravel > DATABASE > ADMINER

Refer to the DB information on the DATABASE tab of the dashboard. And Update the Laravel .env file.

DB_CONNECTION=mysql
DB_HOST=192.168.95.100
DB_PORT=4030
DB_DATABASE=local
DB_USERNAME=root
DB_PASSWORD=root

Move to app directory and migrate DB.

$ cd ~/Local\ Sites/laravel/app
$ php artisan migrate

If the message Migration table created successfully. is displayed, the database is ready.

Mail Settings

Update the Laravel .env file for Mailhog settings.

MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025

Auth Settings

Download package laravel/ui.

$ composer require laravel/ui --dev

Generate authentication scaffolding.

# Bootstrap
$ php artisan ui bootstrap --auth

# Vue
$ php artisan ui vue --auth

# React
$ php artisan ui react --auth

Install and build package using npm.

$ npm install && npm run dev

Visit https://laravel.local in your browser, you can register account.

IDE Settings

Laravel IDE Helper

Launch terminal, and download package.

$ composer require --dev barryvdh/laravel-ide-helper

Clear compiled files.

$ php artisan clear-compiled

Generate helper file.

$ php artisan ide-helper:generate

You can configure your composer.json to do this after each commit:

"scripts":{
    "post-update-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postUpdate",
        "@php artisan ide-helper:generate",
        "@php artisan ide-helper:meta"
    ]
},

sandbox-laravel-by-flywheel's People

Contributors

dependabot[bot] avatar ko31 avatar

Watchers

 avatar  avatar

Forkers

llody20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.