Skip to content

Commit 6070d93

Browse files
committed
Working on new directory structure.
1 parent 8aa4a0a commit 6070d93

25 files changed

+225
-220
lines changed

app/config/app.php

+6-7
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,20 @@
9898
/*
9999
* Application Service Providers...
100100
*/
101-
'AppServiceProvider',
102-
'ArtisanServiceProvider',
103-
'ErrorServiceProvider',
104-
'LogServiceProvider',
101+
'Providers\AppServiceProvider',
102+
'Providers\ArtisanServiceProvider',
103+
'Providers\ErrorServiceProvider',
104+
'Providers\FilterServiceProvider',
105+
'Providers\LogServiceProvider',
106+
'Providers\RouteServiceProvider',
105107

106108
/*
107109
* Laravel Framework Service Providers...
108110
*/
109111
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
110112
'Illuminate\Auth\AuthServiceProvider',
111113
'Illuminate\Cache\CacheServiceProvider',
112-
'Illuminate\Session\CommandsServiceProvider',
113114
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
114-
'Illuminate\Routing\ControllerServiceProvider',
115115
'Illuminate\Cookie\CookieServiceProvider',
116116
'Illuminate\Database\DatabaseServiceProvider',
117117
'Illuminate\Encryption\EncryptionServiceProvider',
@@ -132,7 +132,6 @@
132132
'Illuminate\Translation\TranslationServiceProvider',
133133
'Illuminate\Validation\ValidationServiceProvider',
134134
'Illuminate\View\ViewServiceProvider',
135-
'Illuminate\Workbench\WorkbenchServiceProvider',
136135

137136
),
138137

app/config/auth.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
|
2929
*/
3030

31-
'model' => 'User',
31+
'model' => 'App\User',
3232

3333
/*
3434
|--------------------------------------------------------------------------
@@ -59,13 +59,9 @@
5959
*/
6060

6161
'reminder' => array(
62-
6362
'email' => 'emails.auth.reminder',
64-
6563
'table' => 'password_reminders',
66-
6764
'expire' => 60,
68-
6965
),
7066

7167
);

app/controllers/.gitkeep

Whitespace-only changes.

app/controllers/BaseController.php

-18
This file was deleted.

app/routing/filters.php

-93
This file was deleted.

app/routing/routes.php

-27
This file was deleted.

app/src/User.php renamed to app/src/App/User.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
<?php
1+
<?php namespace App;
22

3+
use Eloquent;
34
use Illuminate\Auth\UserTrait;
45
use Illuminate\Auth\UserInterface;
56
use Illuminate\Auth\Reminders\RemindableTrait;
@@ -21,6 +22,6 @@ class User extends Eloquent implements UserInterface, RemindableInterface {
2122
*
2223
* @var array
2324
*/
24-
protected $hidden = array('password', 'remember_token');
25+
protected $hidden = ['password', 'remember_token'];
2526

2627
}

app/commands/InspireCommand.php renamed to app/src/Console/InspireCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class InspireCommand extends Command {
1919
*
2020
* @var string
2121
*/
22-
protected $description = 'Display an inpiring quote.';
22+
protected $description = 'Display an inpiring quote';
2323

2424
/**
2525
* Create a new command instance.
@@ -38,7 +38,7 @@ public function __construct()
3838
*/
3939
public function fire()
4040
{
41-
$this->info(Inspiring::quote());
41+
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
4242
}
4343

4444
}

app/controllers/HomeController.php renamed to app/src/Http/Controllers/HomeController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
class HomeController extends BaseController {
3+
class HomeController extends Controller {
44

55
/*
66
|--------------------------------------------------------------------------

app/src/Http/Filters/AuthFilter.php

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use Illuminate\Http\Request;
4+
5+
class AuthFilter {
6+
7+
/**
8+
* Run the request filter.
9+
*
10+
* @param \Illuminate\Http\Request $request
11+
* @return mixed
12+
*/
13+
public function filter(Request $request)
14+
{
15+
if (Auth::guest())
16+
{
17+
if ($request->ajax())
18+
{
19+
return Response::make('Unauthorized', 401);
20+
}
21+
else
22+
{
23+
return Redirect::guest('login');
24+
}
25+
}
26+
}
27+
28+
}
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
class BasicAuthFilter {
4+
5+
/**
6+
* Run the request filter.
7+
*
8+
* @return mixed
9+
*/
10+
public function filter()
11+
{
12+
return Auth::basic();
13+
}
14+
15+
}

app/src/Http/Filters/CsrfFilter.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
use Illuminate\Http\Request;
4+
use Illuminate\Routing\Route;
5+
6+
class CsrfFilter {
7+
8+
/**
9+
* Run the request filter.
10+
*
11+
* @return mixed
12+
*/
13+
public function filter(Route $route, Request $request)
14+
{
15+
if (Session::token() != $request->input('_token'))
16+
{
17+
throw new Illuminate\Session\TokenMismatchException;
18+
}
19+
}
20+
21+
}

app/src/Http/Filters/GuestFilter.php

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
class GuestFilter {
4+
5+
/**
6+
* Run the request filter.
7+
*
8+
* @return mixed
9+
*/
10+
public function filter()
11+
{
12+
if (Auth::check())
13+
{
14+
return Redirect::to('/');
15+
}
16+
}
17+
18+
}
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
class MaintenanceFilter {
4+
5+
/**
6+
* Run the request filter.
7+
*
8+
* @return mixed
9+
*/
10+
public function filter()
11+
{
12+
if (App::isDownForMaintenance())
13+
{
14+
return Response::make('Be right back!');
15+
}
16+
}
17+
18+
}
File renamed without changes.

app/src/Providers/AppServiceProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php namespace Providers;
22

33
use Illuminate\Support\ServiceProvider;
44

+3-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
<?php
1+
<?php namespace Providers;
22

3+
use InspireCommand;
34
use Illuminate\Support\ServiceProvider;
45

56
class ArtisanServiceProvider extends ServiceProvider {
@@ -21,25 +22,7 @@ public function boot()
2122
*/
2223
public function register()
2324
{
24-
$this->registerInspireCommand();
25-
26-
$this->commands('commands.inspire');
27-
}
28-
29-
/**
30-
* Register the Inspire Artisan command.
31-
*
32-
* @return void
33-
*/
34-
protected function registerInspireCommand()
35-
{
36-
// Each available Artisan command must be registered with the console so
37-
// that it is available to be called. We'll register every command so
38-
// the console gets access to each of the command object instances.
39-
$this->app->bindShared('commands.inspire', function()
40-
{
41-
return new InspireCommand;
42-
});
25+
$this->commands('InspireCommand');
4326
}
4427

4528
}

0 commit comments

Comments
 (0)