Last active
December 15, 2015 15:58
-
-
Save marcellobenigno/5285325 to your computer and use it in GitHub Desktop.
Dicas sobre o Laravel
This file contains 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
//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