Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
d3bf13b1
Commit
d3bf13b1
authored
Oct 14, 2014
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on routing and providers.
parent
5bb07523
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
36 deletions
+36
-36
app/Http/Controllers/HomeController.php
+5
-7
app/Http/routes.php
+0
-14
app/Providers/EventServiceProvider.php
+9
-0
app/Providers/RouteServiceProvider.php
+22
-15
No files found.
app/Http/Controllers/HomeController.php
View file @
d3bf13b1
...
...
@@ -4,19 +4,17 @@ class HomeController {
/*
|--------------------------------------------------------------------------
|
Default
Home Controller
| Home Controller
|--------------------------------------------------------------------------
|
| You may wish to use controllers instead of, or in addition to, Closure
| based routes. That's great! Here is an example controller method to
| get you started. To route to this controller, just add the route:
|
| $router->get('/', 'HomeController@index');
| Controller methods are called when a request enters the application
| with their assigned URI. The URI a method responds to may be set
| via simple annotations. Here is an example to get you started!
|
*/
/**
* @Get("/"
, as="home"
)
* @Get("/")
*/
public
function
index
()
{
...
...
app/Http/routes.php
deleted
100644 → 0
View file @
5bb07523
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
$router
->
get
(
'/'
,
'HomeController@index'
);
app/Providers/EventServiceProvider.php
View file @
d3bf13b1
...
...
@@ -15,4 +15,13 @@ class EventServiceProvider extends ServiceProvider {
],
];
/**
* The classes to scan for event annotations.
*
* @var array
*/
protected
$scan
=
[
//
];
}
app/Providers/RouteServiceProvider.php
View file @
d3bf13b1
<?php
namespace
App\Providers
;
use
Illuminate\Routing\Router
;
use
Illuminate\Contracts\Routing\UrlGenerator
;
use
Illuminate\Foundation\Support\Providers\RouteServiceProvider
as
ServiceProvider
;
class
RouteServiceProvider
extends
ServiceProvider
{
/**
* The root controller namespace for URL generation.
*
* @var string
*/
protected
$rootUrlNamespace
=
'App\Http\Controllers'
;
/**
* The controllers to scan for route annotations.
*
* @var array
*/
protected
$scan
=
[
'App\Http\Controllers\HomeController'
,
'App\Http\Controllers\Auth\AuthController'
,
'App\Http\Controllers\Auth\PasswordController'
,
];
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @param Router $router
* @param UrlGenerator $url
* @return void
*/
public
function
before
(
Router
$router
,
UrlGenerator
$url
)
public
function
before
(
Router
$router
)
{
$url
->
setRootControllerNamespace
(
'App\Http\Controllers'
);
//
}
/**
...
...
@@ -25,18 +41,9 @@ class RouteServiceProvider extends ServiceProvider {
*
* @return void
*/
public
function
map
()
{
// Once the application has booted, we will include the default routes
// file. This "namespace" helper will load the routes file within a
// route group which automatically sets the controller namespace.
$this
->
app
->
booted
(
function
()
{
$this
->
namespaced
(
'App\Http\Controllers'
,
function
(
Router
$router
)
public
function
map
(
Router
$router
)
{
require
app_path
()
.
'/Http/routes.php'
;
});
});
//
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment