Skip to content

Instantly share code, notes, and snippets.

@icarofreire
Last active April 5, 2018 12:11
Show Gist options
  • Select an option

  • Save icarofreire/1fdd9b8301271846058e47824fb49e98 to your computer and use it in GitHub Desktop.

Select an option

Save icarofreire/1fdd9b8301271846058e47824fb49e98 to your computer and use it in GitHub Desktop.
Anotações de comandos do Laravel.
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