jakjr / keeper
Uma abstração do Laravel5 Session para manter valores
Installs: 10 223
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.5.9
- illuminate/support: ^5.1
Requires (Dev)
- phpunit/phpunit: 4.*
README
Uma abstração do Laravel Session para guardar valores de inputs (pages, filters, etc)
Registrar o ServiceProvider (app.php)
'Jakjr\Keeper\KeeperServiceProvider',
Uso no Controller
class KeepController extends BaseController {
private $keeper;
function __construct()
{
$this->keeper = App::make('keeper', [$this]);
}
public function index()
{
return View::make('keep.index')
->with('keeper', $this->keeper);
}
public function keep()
{
$this->keeper->keep(Input::only(['name', 'page']));
return Redirect::back();
}
}
Uso na View
{{Form::open(['action'=>'KeepController@keep'])}}
{{Form::text('name', $keeper->get('name'))}}
{{Form::text('page', $keeper->get('page'))}}
{{Form::text('teste', $keeper->get('teste'))}}
{{Form::submit()}}
{{Form::close()}}