Created
February 2, 2017 19:29
-
-
Save alissonsilvas/e2b513201f1391bb3e56c230d3b130b6 to your computer and use it in GitHub Desktop.
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
//Model | |
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
use Codecasts\Presenter\Presentable; | |
class Tblpreco extends Model | |
{ | |
use Presentable; | |
protected $presenter = \App\Presenter\TblprecoPresenter::class; | |
public $fillable = ['emissao','hsemissao','users_id','categoria','valor','vigencia']; | |
protected $dates = ['vigencia','emissao']; | |
protected $table = 'tblpreco'; | |
public $timestamps = false; | |
} | |
//PRESENTER | |
namespace App\Presenter\TblprecoPresenter; | |
use Codecasts\Presenter\Presenter; | |
class TblprecoPresenter extends Presenter | |
{ | |
} | |
//CONTROLLER | |
dd($tblpreco->present()->vigencia); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment