Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
4e5a1517
Commit
4e5a1517
authored
Sep 19, 2014
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Embrace contracts.
parent
7c8b8e7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
ErrorServiceProvider.php
app/Providers/ErrorServiceProvider.php
+8
-4
LogServiceProvider.php
app/Providers/LogServiceProvider.php
+3
-3
RouteServiceProvider.php
app/Providers/RouteServiceProvider.php
+5
-4
No files found.
app/Providers/ErrorServiceProvider.php
View file @
4e5a1517
<?php
namespace
App\Providers
;
<?php
namespace
App\Providers
;
use
App
,
Log
,
Exception
;
use
Exception
;
use
Illuminate\Contracts\Logging\Log
;
use
Illuminate\Support\ServiceProvider
;
use
Illuminate\Support\ServiceProvider
;
use
Illuminate\Contracts\Exception\Handler
;
class
ErrorServiceProvider
extends
ServiceProvider
{
class
ErrorServiceProvider
extends
ServiceProvider
{
/**
/**
* Register any error handlers.
* Register any error handlers.
*
*
* @param Handler $handler
* @param Log $log
* @return void
* @return void
*/
*/
public
function
boot
()
public
function
boot
(
Handler
$handler
,
Log
$log
)
{
{
// Here you may handle any errors that occur in your application, including
// Here you may handle any errors that occur in your application, including
// logging them or displaying custom views for specific errors. You may
// logging them or displaying custom views for specific errors. You may
// even register several error handlers to handle different types of
// even register several error handlers to handle different types of
// exceptions. If nothing is returned, the default error view is
// exceptions. If nothing is returned, the default error view is
// shown, which includes a detailed stack trace during debug.
// shown, which includes a detailed stack trace during debug.
App
::
error
(
function
(
Exception
$e
)
$handler
->
error
(
function
(
Exception
$e
)
use
(
$log
)
{
{
Log
::
error
(
$e
);
$log
->
error
(
$e
);
});
});
}
}
...
...
app/Providers/LogServiceProvider.php
View file @
4e5a1517
<?php
namespace
App\Providers
;
<?php
namespace
App\Providers
;
use
Log
;
use
Illuminate\Contracts\Logging\
Log
;
use
Illuminate\Support\ServiceProvider
;
use
Illuminate\Support\ServiceProvider
;
class
LogServiceProvider
extends
ServiceProvider
{
class
LogServiceProvider
extends
ServiceProvider
{
...
@@ -10,9 +10,9 @@ class LogServiceProvider extends ServiceProvider {
...
@@ -10,9 +10,9 @@ class LogServiceProvider extends ServiceProvider {
*
*
* @return void
* @return void
*/
*/
public
function
boot
()
public
function
boot
(
Log
$log
)
{
{
Log
::
useFiles
(
storage_path
()
.
'/logs/laravel.log'
);
$log
->
useFiles
(
storage_path
()
.
'/logs/laravel.log'
);
}
}
/**
/**
...
...
app/Providers/RouteServiceProvider.php
View file @
4e5a1517
<?php
namespace
App\Providers
;
<?php
namespace
App\Providers
;
use
App
,
URL
;
use
Illuminate\Contracts\Routing\UrlGenerator
;
use
Illuminate\Routing\RouteServiceProvider
as
ServiceProvider
;
use
Illuminate\Routing\RouteServiceProvider
as
ServiceProvider
;
class
RouteServiceProvider
extends
ServiceProvider
{
class
RouteServiceProvider
extends
ServiceProvider
{
...
@@ -10,11 +10,12 @@ class RouteServiceProvider extends ServiceProvider {
...
@@ -10,11 +10,12 @@ class RouteServiceProvider extends ServiceProvider {
*
*
* Register any model bindings or pattern based filters.
* Register any model bindings or pattern based filters.
*
*
* @param UrlGenerator $url
* @return void
* @return void
*/
*/
public
function
before
()
public
function
before
(
UrlGenerator
$url
)
{
{
URL
::
setRootControllerNamespace
(
$url
->
setRootControllerNamespace
(
trim
(
config
(
'namespaces.controllers'
),
'\\'
)
trim
(
config
(
'namespaces.controllers'
),
'\\'
)
);
);
}
}
...
@@ -26,7 +27,7 @@ class RouteServiceProvider extends ServiceProvider {
...
@@ -26,7 +27,7 @@ class RouteServiceProvider extends ServiceProvider {
*/
*/
public
function
map
()
public
function
map
()
{
{
App
::
booted
(
function
()
$this
->
app
->
booted
(
function
()
{
{
// Once the application has booted, we will include the default routes
// Once the application has booted, we will include the default routes
// file. This "namespace" helper will load the routes file within a
// file. This "namespace" helper will load the routes file within a
...
...
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