Skip to content

Commit

Permalink
move cas_route into namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
leo108 committed Apr 3, 2018
1 parent 8a807d6 commit 46d2da7
Show file tree
Hide file tree
Showing 5 changed files with 397 additions and 389 deletions.
3 changes: 1 addition & 2 deletions src/CASServerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ class CASServerServiceProvider extends ServiceProvider
*/
public function register()
{
// TODO: Implement register() method.
}

/**
* @inheritdoc
*/
public function boot()
{
require __DIR__.'/Utils/helpers.php';
require __DIR__.'/helpers.php';

if (!$this->app->routesAreCached()) {
require __DIR__.'/Http/routes.php';
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/SecurityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Leo108\CAS\Repositories\PGTicketRepository;
use Leo108\CAS\Repositories\ServiceRepository;
use Leo108\CAS\Repositories\TicketRepository;
use function Leo108\CAS\cas_route;

class SecurityController extends Controller
{
Expand Down
22 changes: 0 additions & 22 deletions src/Utils/helpers.php

This file was deleted.

22 changes: 22 additions & 0 deletions src/helpers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* Created by PhpStorm.
* User: chenyihong
* Date: 16/8/14
* Time: 11:25
*/

namespace Leo108\CAS;

/**
* @param string $name
* @param array $parameters
* @param bool $absolute
* @return string
*/
function cas_route($name, $parameters = [], $absolute = true)
{
$name = config('cas.router.name_prefix').$name;

return route($name, $parameters, $absolute);
}
Loading

0 comments on commit 46d2da7

Please sign in to comment.