Articles by "Laravel"
Hiển thị các bài đăng có nhãn Laravel. Hiển thị tất cả bài đăng

1. Cài Laravel cùng với các package sau:
  • laravelcollective/html
  • spatie/laravel-permission

2. Thêm 2 dòng lệnh cho file User.php


  • use Spatie\Permission\Traits\HasRoles;
  • use HasRoles;

3. Tạo Seed file và chạy lệnh php artisan db:seed



Helper Source laravel-ide-helper GITHUB Official

CMD Terminal

Open CMD terminal
Go to your Laravel project root directory by

cd C:\xampp\htdocs\laravel

Install

Require this package with composer using the following command:

composer require barryvdh/laravel-ide-helper

After updating composer, add the service provider to the providers array in config/app.php

Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,


Automatic phpDoc generation for Laravel Facades

You can now re-generate the docs yourself (for future updates)

php artisan ide-helper:generate

Note: bootstrap/compiled.php has to be cleared first, so run 

php artisan clear-compiled

before generating (and 

php artisan optimize

after).

You can configure your composer.json to do this after each commit:
You can also publish the config file to change implementations (ie. interface to specific class) or set defaults for --helpers or --sublime.

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