File tree 4 files changed +39
-38
lines changed 4 files changed +39
-38
lines changed Original file line number Diff line number Diff line change 1
1
<?php namespace App \Console ;
2
2
3
3
use Exception ;
4
+ use Illuminate \Console \Scheduling \Schedule ;
4
5
use Illuminate \Foundation \Console \Kernel as ConsoleKernel ;
5
6
6
7
class Kernel extends ConsoleKernel {
@@ -15,26 +16,15 @@ class Kernel extends ConsoleKernel {
15
16
];
16
17
17
18
/**
18
- * Run the console application.
19
+ * Define the application's command schedule .
19
20
*
20
- * @param \Symfony\Component\Console\Input\InputInterface $input
21
- * @param \Symfony\Component\Console\Output\OutputInterface $output
22
- * @return int
21
+ * @param \Illuminate\Console\Scheduling\Schedule $schedule
22
+ * @return void
23
23
*/
24
- public function handle ( $ input , $ output = null )
24
+ protected function schedule ( Schedule $ schedule )
25
25
{
26
- try
27
- {
28
- return parent ::handle ($ input , $ output );
29
- }
30
- catch (Exception $ e )
31
- {
32
- $ this ->reportException ($ e );
33
-
34
- $ this ->renderException ($ output , $ e );
35
-
36
- return 1 ;
37
- }
26
+ $ schedule ->artisan ('foo ' )
27
+ ->hourly ();
38
28
}
39
29
40
30
}
Original file line number Diff line number Diff line change
1
+ <?php namespace App \Exceptions ;
2
+
3
+ use Exception ;
4
+ use Illuminate \Foundation \Exceptions \Handler as ExceptionHandler ;
5
+
6
+ class Handler extends ExceptionHandler {
7
+
8
+ /**
9
+ * Report or log an exception.
10
+ *
11
+ * @param \Exception $e
12
+ * @return void
13
+ */
14
+ public function report (Exception $ e )
15
+ {
16
+ return parent ::report ($ e );
17
+ }
18
+
19
+ /**
20
+ * Render an exception into a response.
21
+ *
22
+ * @param \Illuminate\Http\Request $request
23
+ * @param \Exception $e
24
+ * @return \Illuminate\Http\Response
25
+ */
26
+ public function render ($ request , Exception $ e )
27
+ {
28
+ return parent ::render ($ request , $ e );
29
+ }
30
+
31
+ }
Original file line number Diff line number Diff line change @@ -19,24 +19,4 @@ class Kernel extends HttpKernel {
19
19
'Illuminate\Foundation\Http\Middleware\VerifyCsrfToken ' ,
20
20
];
21
21
22
- /**
23
- * Handle an incoming HTTP request.
24
- *
25
- * @param \Illuminate\Http\Request $request
26
- * @return \Illuminate\Http\Response
27
- */
28
- public function handle ($ request )
29
- {
30
- try
31
- {
32
- return parent ::handle ($ request );
33
- }
34
- catch (Exception $ e )
35
- {
36
- $ this ->reportException ($ e );
37
-
38
- return $ this ->renderException ($ request , $ e );
39
- }
40
- }
41
-
42
22
}
Original file line number Diff line number Diff line change 38
38
39
39
$ app ->singleton (
40
40
'Illuminate\Contracts\Debug\ExceptionHandler ' ,
41
- 'Illuminate\Foundation\Debug \ExceptionHandler '
41
+ 'App\Exceptions \ExceptionHandler '
42
42
);
43
43
44
44
/*
You can’t perform that action at this time.
0 commit comments