Skip to content

Commit

Permalink
- Fixed namespace from App to GlucosioAPI.
Browse files Browse the repository at this point in the history
- Fixed name object called from DatabaseSeeder. (App to GlucosioAPI)
- Now 'users' and 'readings' routes only works with version 'v1' of API.
  • Loading branch information
MirkoPizii committed Oct 31, 2015
1 parent 80d5e04 commit af1790a
Show file tree
Hide file tree
Showing 32 changed files with 74 additions and 73 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/Inspire.php
@@ -1,6 +1,6 @@
<?php

namespace App\Console\Commands;
namespace GlucosioAPI\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Kernel.php
@@ -1,6 +1,6 @@
<?php

namespace App\Console;
namespace GlucosioAPI\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
Expand All @@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
\App\Console\Commands\Inspire::class,
\GlucosioAPI\Console\Commands\Inspire::class,
];

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Events/Event.php
@@ -1,6 +1,6 @@
<?php

namespace App\Events;
namespace GlucosioAPI\Events;

abstract class Event
{
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Handler.php
@@ -1,6 +1,6 @@
<?php

namespace App\Exceptions;
namespace GlucosioAPI\Exceptions;

use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Auth/AuthController.php
@@ -1,10 +1,10 @@
<?php

namespace App\Http\Controllers\Auth;
namespace GlucosioAPI\Http\Controllers\Auth;

use App\User;
use GlucosioAPI\User;
use Validator;
use App\Http\Controllers\Controller;
use GlucosioAPI\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Auth/PasswordController.php
@@ -1,8 +1,8 @@
<?php

namespace App\Http\Controllers\Auth;
namespace GlucosioAPI\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use GlucosioAPI\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;

class PasswordController extends Controller
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Controller.php
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Controllers;
namespace GlucosioAPI\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
Expand Down
10 changes: 5 additions & 5 deletions app/Http/Controllers/ReadingsController.php
@@ -1,13 +1,13 @@
<?php

namespace App\Http\Controllers;
namespace GlucosioAPI\Http\Controllers;

use App\Readingtype;
use GlucosioAPI\Readingtype;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Reading as Reading;
use GlucosioAPI\Http\Requests;
use GlucosioAPI\Http\Controllers\Controller;
use GlucosioAPI\Reading as Reading;

class ReadingsController extends Controller
{
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/ReadingtypesController.php
@@ -1,11 +1,11 @@
<?php

namespace App\Http\Controllers;
namespace GlucosioAPI\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use GlucosioAPI\Http\Requests;
use GlucosioAPI\Http\Controllers\Controller;

class ReadingtypesController extends Controller
{
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/UsersController.php
@@ -1,12 +1,12 @@
<?php

namespace App\Http\Controllers;
namespace GlucosioAPI\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\User as User;
use GlucosioAPI\Http\Requests;
use GlucosioAPI\Http\Controllers\Controller;
use GlucosioAPI\User as User;

class UsersController extends Controller
{
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Kernel.php
@@ -1,6 +1,6 @@
<?php

namespace App\Http;
namespace GlucosioAPI\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;

Expand All @@ -13,7 +13,7 @@ class Kernel extends HttpKernel
*/
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
\App\Http\Middleware\EncryptCookies::class,
\GlucosioAPI\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
Expand All @@ -25,8 +25,8 @@ class Kernel extends HttpKernel
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth' => \GlucosioAPI\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'guest' => \GlucosioAPI\Http\Middleware\RedirectIfAuthenticated::class,
];
}
2 changes: 1 addition & 1 deletion app/Http/Middleware/Authenticate.php
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Middleware;
namespace GlucosioAPI\Http\Middleware;

use Closure;
use Illuminate\Contracts\Auth\Guard;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/EncryptCookies.php
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Middleware;
namespace GlucosioAPI\Http\Middleware;

use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/RedirectIfAuthenticated.php
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Middleware;
namespace GlucosioAPI\Http\Middleware;

use Closure;
use Illuminate\Contracts\Auth\Guard;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/VerifyCsrfToken.php
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Middleware;
namespace GlucosioAPI\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Request.php
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Requests;
namespace GlucosioAPI\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

Expand Down
7 changes: 4 additions & 3 deletions app/Http/routes.php
Expand Up @@ -12,9 +12,10 @@
*/



Route::resource('users', 'UsersController');
Route::resource('readings', 'ReadingsController');
Route::group(['prefix' => 'v1'], function () {
Route::resource('users', 'UsersController');
Route::resource('readings', 'ReadingsController');
});

Route::get('/', function () {

Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/Job.php
@@ -1,6 +1,6 @@
<?php

namespace App\Jobs;
namespace GlucosioAPI\Jobs;

use Illuminate\Bus\Queueable;

Expand Down
2 changes: 1 addition & 1 deletion app/Providers/AppServiceProvider.php
@@ -1,6 +1,6 @@
<?php

namespace App\Providers;
namespace GlucosioAPI\Providers;

use Illuminate\Support\ServiceProvider;

Expand Down
4 changes: 2 additions & 2 deletions app/Providers/AuthServiceProvider.php
@@ -1,6 +1,6 @@
<?php

namespace App\Providers;
namespace GlucosioAPI\Providers;

use Illuminate\Contracts\Auth\Access\Gate as GateContract;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
Expand All @@ -13,7 +13,7 @@ class AuthServiceProvider extends ServiceProvider
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
'GlucosioAPI\Model' => 'GlucosioAPI\Policies\ModelPolicy',
];

/**
Expand Down
6 changes: 3 additions & 3 deletions app/Providers/EventServiceProvider.php
@@ -1,6 +1,6 @@
<?php

namespace App\Providers;
namespace GlucosioAPI\Providers;

use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
Expand All @@ -13,8 +13,8 @@ class EventServiceProvider extends ServiceProvider
* @var array
*/
protected $listen = [
'App\Events\SomeEvent' => [
'App\Listeners\EventListener',
'GlucosioAPI\Events\SomeEvent' => [
'GlucosioAPI\Listeners\EventListener',
],
];

Expand Down
4 changes: 2 additions & 2 deletions app/Providers/RouteServiceProvider.php
@@ -1,6 +1,6 @@
<?php

namespace App\Providers;
namespace GlucosioAPI\Providers;

use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
Expand All @@ -14,7 +14,7 @@ class RouteServiceProvider extends ServiceProvider
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
protected $namespace = 'GlucosioAPI\Http\Controllers';

/**
* Define your route model bindings, pattern filters, etc.
Expand Down
6 changes: 3 additions & 3 deletions app/Reading.php
@@ -1,6 +1,6 @@
<?php

namespace App;
namespace GlucosioAPI;

use Illuminate\Database\Eloquent\Model;

Expand All @@ -10,11 +10,11 @@ class Reading extends Model

public function user()
{
return $this->belongsTo('App\User');
return $this->belongsTo('GlucosioAPI\User');
}

public function readingtype()
{
return $this->belongsTo('App\Readingtype');
return $this->belongsTo('GlucosioAPI\Readingtype');
}
}
2 changes: 1 addition & 1 deletion app/Readingtype.php
@@ -1,6 +1,6 @@
<?php

namespace App;
namespace GlucosioAPI;

use Illuminate\Database\Eloquent\Model;

Expand Down
4 changes: 2 additions & 2 deletions app/User.php
@@ -1,6 +1,6 @@
<?php

namespace App;
namespace GlucosioAPI;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
Expand Down Expand Up @@ -39,6 +39,6 @@ class User extends Model implements AuthenticatableContract,

public function readings()
{
return $this->hasMany('App\Reading');
return $this->hasMany('GlucosioAPI\Reading');
}
}
6 changes: 3 additions & 3 deletions bootstrap/app.php
Expand Up @@ -28,17 +28,17 @@

$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
GlucosioAPI\Http\Kernel::class
);

$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
GlucosioAPI\Console\Kernel::class
);

$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
GlucosioAPI\Exceptions\Handler::class
);

/*
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -18,7 +18,7 @@
"database"
],
"psr-4": {
"App\\": "app/"
"GlucosioAPI\\": "app/"
}
},
"autoload-dev": {
Expand Down
8 changes: 4 additions & 4 deletions config/app.php
Expand Up @@ -140,10 +140,10 @@
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
GlucosioAPI\Providers\AppServiceProvider::class,
GlucosioAPI\Providers\AuthServiceProvider::class,
GlucosioAPI\Providers\EventServiceProvider::class,
GlucosioAPI\Providers\RouteServiceProvider::class,

],

Expand Down
2 changes: 1 addition & 1 deletion config/auth.php
Expand Up @@ -28,7 +28,7 @@
|
*/

'model' => App\User::class,
'model' => GlucosioAPI\User::class,

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion config/services.php
Expand Up @@ -30,7 +30,7 @@
],

'stripe' => [
'model' => App\User::class,
'model' => GlucosioAPI\User::class,
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
],
Expand Down

0 comments on commit af1790a

Please sign in to comment.