Replaced Session::get() with session()

This commit is contained in:
James Cole
2016-02-04 07:27:03 +01:00
parent bd40615f8e
commit c1ecc62ac1
23 changed files with 126 additions and 136 deletions

View File

@@ -25,7 +25,7 @@ class CategoryController extends Controller
{
/**
* @codeCoverageIgnore
*
*/
public function __construct()
{
@@ -40,7 +40,7 @@ class CategoryController extends Controller
public function create()
{
// put previous url in session if not redirect from store (not "create another").
if (Session::get('categories.create.fromStore') !== true) {
if (session('categories.create.fromStore') !== true) {
Session::put('categories.create.url', URL::previous());
}
Session::forget('categories.create.fromStore');
@@ -83,7 +83,7 @@ class CategoryController extends Controller
Session::flash('success', 'The category "' . e($name) . '" was deleted.');
Preferences::mark();
return redirect(Session::get('categories.delete.url'));
return redirect(session('categories.delete.url'));
}
/**
@@ -96,7 +96,7 @@ class CategoryController extends Controller
$subTitle = trans('firefly.edit_category', ['name' => $category->name]);
// put previous url in session if not redirect from store (not "return_to_edit").
if (Session::get('categories.edit.fromUpdate') !== true) {
if (session('categories.edit.fromUpdate') !== true) {
Session::put('categories.edit.url', URL::previous());
}
Session::forget('categories.edit.fromUpdate');
@@ -133,8 +133,8 @@ class CategoryController extends Controller
*/
public function noCategory(CRI $repository)
{
$start = Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->startOfMonth());
$start = session('start', Carbon::now()->startOfMonth());
$end = session('end', Carbon::now()->startOfMonth());
$list = $repository->listNoCategory($start, $end);
$subTitle = trans(
'firefly.without_category_between',
@@ -284,7 +284,7 @@ class CategoryController extends Controller
}
// redirect to previous URL.
return redirect(Session::get('categories.edit.url'));
return redirect(session('categories.edit.url'));
}