-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #675 from portabilis/portabilis-patch-2019-11-01
[2.2] Portabilis patch 01/11/2019
- Loading branch information
Showing
33 changed files
with
1,138 additions
and
132 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App\Extensions; | ||
|
||
use EderSoares\Laravel\PlugAndPlay\Foundation\PlugAndPlayPackages; | ||
use Illuminate\Foundation\Application as LaravelApplication; | ||
|
||
class Application extends LaravelApplication | ||
{ | ||
use PlugAndPlayPackages; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class LegacyAddress extends Model | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $table = 'public.logradouro'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $primaryKey = 'idlog'; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'idtlog', | ||
'nome', | ||
'idmun', | ||
'geom', | ||
'ident_oficial', | ||
'idpes_rev', | ||
'data_rev', | ||
'origem_gravacao', | ||
'idpes_cad', | ||
'data_cad', | ||
'operacao', | ||
]; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
public $timestamps = false; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
static::creating(function ($model) { | ||
$model->origem_gravacao = 'M'; | ||
$model->data_cad = now(); | ||
$model->operacao = 'I'; | ||
}); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\Relations\HasMany; | ||
|
||
class LegacyCity extends Model | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $table = 'public.municipio'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $primaryKey = 'idmun'; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'idmun', | ||
'nome', | ||
'sigla_uf', | ||
'area_km2', | ||
'idmreg', | ||
'idasmun', | ||
'cod_ibge', | ||
'geom', | ||
'tipo', | ||
'idmun_pai', | ||
'idpes_rev', | ||
'idpes_cad', | ||
'data_rev', | ||
'data_cad', | ||
'origem_gravacao', | ||
'operacao', | ||
'nome_limpo', | ||
]; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
public $timestamps = false; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
static::creating(function ($model) { | ||
$model->origem_gravacao = 'M'; | ||
$model->data_cad = now(); | ||
$model->operacao = 'I'; | ||
}); | ||
} | ||
|
||
/** | ||
* @return HasMany | ||
*/ | ||
public function districts() | ||
{ | ||
return $this->hasMany(LegacyDistrict::class, 'idmun', 'idmun'); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class LegacyDistrict extends Model | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $table = 'public.distrito'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $primaryKey = 'iddis'; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'idmun', | ||
'geom', | ||
'iddis', | ||
'nome', | ||
'cod_ibge', | ||
'idpes_rev', | ||
'data_rev', | ||
'origem_gravacao', | ||
'idpes_cad', | ||
'data_cad', | ||
'operacao', | ||
]; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
public $timestamps = false; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
static::creating(function ($model) { | ||
$district = LegacyDistrict::query()->whereKey($model->idmun)->first(); | ||
|
||
$model->origem_gravacao = 'M'; | ||
$model->data_cad = now(); | ||
$model->operacao = 'I'; | ||
$model->iddis = $district->getKey(); | ||
}); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class LegacyExternalAddress extends Model | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $table = 'cadastro.endereco_externo'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $primaryKey = 'idpes'; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'idpes', | ||
'tipo', | ||
'idtlog', | ||
'logradouro', | ||
'numero', | ||
'letra', | ||
'complemento', | ||
'bairro', | ||
'cep', | ||
'cidade', | ||
'sigla_uf', | ||
'reside_desde', | ||
'idpes_rev', | ||
'data_rev', | ||
'origem_gravacao', | ||
'idpes_cad', | ||
'data_cad', | ||
'operacao', | ||
'bloco', | ||
'andar', | ||
'apartamento', | ||
'zona_localizacao', | ||
]; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
public $timestamps = false; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
static::creating(function ($model) { | ||
$model->data_cad = now(); | ||
$model->origem_gravacao = 'M'; | ||
$model->operacao = 'I'; | ||
}); | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class LegacyMaritalStatus extends Model | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $table = 'cadastro.estado_civil'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $primaryKey = 'ideciv'; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'descricao', | ||
]; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
public $timestamps = false; | ||
} |
Oops, something went wrong.