laravel 5.5 boilerplate

Install laravel 5.5

laravel new laravel5-boilerplate --version 5.5
cd $_
git init
echo "composer.lock" >> .gitignore
echo "package-lock.json" >> .gitignore
git add .
git commit -m "Initial commit"

Create database for using SQLite

sqlite3 database/database.sqlite .schema

Edit .env

# DB_CONNECTION=mysql
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=homestead
# DB_USERNAME=homestead
# DB_PASSWORD=secret
DB_CONNECTION=sqlite

Make auth && migration

# bootstrap 4
composer require laravelnews/laravel-twbs4
php artisan preset bootstrap4-auth
# bootstrap 3
php artisan make:auth

php artisan migrate
# make storage symbolic link
php artisan storage:link
# install npm package
npm install
chmod -R 777 bootstrap/cache storage

Add first user

php artisan tinker
Psy Shell v0.8.9 (PHP 7.1.6 — cli) by Justin Hileman
>>> $user = new \App\User
>>> $user->name = 'admin'
>>> $user->email = 'admin@some-project.dev'
>>> $user->password = bcrypt('admin')
>>> $user->save();

Install barryvdh/laravel-ide-helper

# install ide-helper
composer require doctrine/dbal
composer require barryvdh/laravel-ide-helper --dev

echo ".phpstorm.meta.php" >> .gitignore
echo "_ide_helper.php" >> .gitignore
echo "_ide_helper_models.php" >> .gitignore

php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config

php artisan ide-helper:generate
php artisan ide-helper:meta
php artisan ide-helper:models -n

Install barryvdh/laravel-debugbar

composer require barryvdh/laravel-debugbar --dev
php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider" --tag=config

Add Font Awesome

Edit resources/assets/saas/app.scss

// Fonts
@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600");
@import "~font-awesome/scss/font-awesome.scss";

...
npm install font-awesome --save-dev

Edit resources/view/layouts/app.blade.php

    ...
    <!-- Styles -->
    <link href="{{ mix('css/app.css') }}" rel="stylesheet">
    ...

...
<!-- Scripts -->
<script src="{{ mix('js/app.js') }}">
...

Edit webpack.mix.js

  .sass('resources/assets/sass/app.scss', 'public/css')
  .sourceMaps()
...
if (mix.inProduction()) {
  mix.version();
}

Build laravel-mix

npm run prod

글쓴이

yupmin

Inside Deep Throat.

댓글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다

This site uses Akismet to reduce spam. Learn how your comment data is processed.