Last active
April 5, 2018 12:11
-
-
Save icarofreire/1fdd9b8301271846058e47824fb49e98 to your computer and use it in GitHub Desktop.
Anotações de comandos do Laravel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| iniciar servidor laravel: | |
| $ php artisan serve | |
| criar migration: | |
| $ php artisan make:migration create_nametable_table | |
| criar migration com nome da tabela: | |
| $ php artisan make:migration create_nametable_table --create=nome_da_tabela | |
| criar modelo: | |
| $ php artisan make:model NameModel | |
| criar modelo com migration: | |
| $ php artisan make:model NameModel -m | |
| criar controler: | |
| $ php artisan make:controller NameController | |
| Uma das formas de alterar a estrutura de uma tabela através de uma migration | |
| é alterar o arquivo de migration que representa a estrutura da tabela e rodar o clássico comando: | |
| $ php artisan migrate:refresh | |
| (primeiramente deleta todas as tabelas, e depois recria novamente com a nova estrutura.) | |
| comando para atualizar a tabela: | |
| $ php artisan migrate | |
| **** | |
| Solução para o problema: "The page has expired due to inactivity. Please refresh and try again". | |
| Colocar abaixo da tag <form >: {{ csrf_field() }} | |
| o arquivo tem que ser .blade.php | |
| **** | |
| Definir os caminhos dos arquivos .CSS e .JS nas paginas .blade da seguinte forma, exemplo: | |
| <link href="{{ asset('css/bootstrap.min.css') }}" rel='stylesheet' type='text/css' /> | |
| <script src="{{ asset('js/jquery.min.js') }}"> </script> | |
| É uma forma mais segura de garantir o funcionamento dos arquivos .css e .js nas páginas. | |
| *** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment