Skip to content

Instantly share code, notes, and snippets.

@marcellobenigno
Last active December 15, 2015 15:58
Show Gist options
  • Save marcellobenigno/5285325 to your computer and use it in GitHub Desktop.
Save marcellobenigno/5285325 to your computer and use it in GitHub Desktop.
Dicas sobre o Laravel
//após a instalação, mudar as permissões:
$ chmod -R 755 app/storage
// Rota passando parametros para um controller:
Route::get('admin/categorias/{id}', 'CategoriasController@destroy');
relacoes n para n :
http://vegibit.com/many-to-many-relationships-in-laravel/
//Exemplo de uma migration espacial:
<?php
class Create_Postes_Table {
public function up()
{
Schema::create('postes', function($table) {
$table->increments('gid');
$table->timestamps();
});
DB::query("SELECT AddGeometryColumn ('public','postes','geom', 29185,'POINT',2)");
}
public function down()
{
Schema::drop('postes');
//DB::query("SELECT DropGeometryColumn ('public','postes')");
}
}
// Mudar a chave primária:
class User extends Eloquent {
protected $primaryKey = 'admin_id';
}
// Uso de partials:
@include('layouts.partials.menu')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment