Skip to content

Instantly share code, notes, and snippets.

@SeRGei93
Last active March 12, 2020 08:20
Show Gist options
  • Save SeRGei93/439fbde3f6fca8756956f47a5a3ecdd1 to your computer and use it in GitHub Desktop.
Save SeRGei93/439fbde3f6fca8756956f47a5a3ecdd1 to your computer and use it in GitHub Desktop.
laravel help
#Плагины
https://github.com/barryvdh/laravel-ide-helper
https://github.com/barryvdh/laravel-debugbar
#Модели
php artisan make:model Models/BlogPost #создать модель
php artisan make:model Models/BlogPost -m #создать модель и миграцию для нее
#Очистить кеш
php artisan config:cache
#Миграции
php artisan migrate #запуситить миграции
php artisan migrate:rollback #откат миграций на 1 шаг
php artisan migrate:rollback --step=3 #откат миграций на 3 шага
php artisan migrate:reset #откатить все миграции (очистить БД)
# Сиды
php artisan make:seeder UserTableSeeder #создать сид
php artisan db:seed #запуск всех сидов
php artisan db:seed --class=UserTableSeeder #запустить конкретный сид
php artisan migrate:refresh --seed #перезаписать сиды
# стэки для стилей
@stack('styles') #объявляем стэк в родительском шаблоне
#пушим стили в стек
@push('styles')
<link rel="stylesheet" href="{{asset('public/css/home.css')}}">
@endpush
#создаем компонент
<div class="card mb-4 box-shadow">
<div class="card-header">
<h4 class="my-0 font-weight-normal">{{ $title }}</h4>
</div>
<div class="card-body">
<h1 class="card-title pricing-card-title">{{ $price }} <small class="text-muted">/ mo</small></h1>
<button type="button" class="btn btn-lg btn-block btn-outline-primary">Sign up for free</button>
</div>
</div>
#подключаем компонент
@component('partials.card')
@slot('price')
$100
@endslot
@slot('title')
Hello
@endslot
@endcomponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment