From ad10b3f8248e3d65a1748d1a9437895c540e575d Mon Sep 17 00:00:00 2001 From: Raza Mehdi Date: Mon, 19 Sep 2016 12:27:49 +0500 Subject: [PATCH] Applied fixes from StyleCI (#2) --- app/Console/Kernel.php | 3 +- app/Exceptions/Handler.php | 12 ++-- app/Http/Controllers/Auth/AuthController.php | 48 ++++++++------ .../Controllers/Auth/TwoFactorController.php | 21 +++--- app/Http/Controllers/Controller.php | 6 +- app/Http/Controllers/HomeController.php | 2 +- app/Http/Kernel.php | 8 +-- app/Http/Middleware/Authenticate.php | 7 +- .../Middleware/RedirectIfAuthenticated.php | 7 +- app/Http/routes.php | 8 +-- app/Providers/AuthServiceProvider.php | 3 +- app/Providers/EventServiceProvider.php | 3 +- app/Providers/RouteServiceProvider.php | 11 ++-- config/app.php | 64 +++++++++---------- config/auth.php | 14 ++-- config/authy.php | 9 +-- config/broadcasting.php | 10 +-- config/cache.php | 14 ++-- config/campaign_monitor.php | 4 +- config/database.php | 40 ++++++------ config/filesystems.php | 8 +-- config/flashalert.php | 8 +-- config/queue.php | 22 +++---- config/services.php | 6 +- database/factories/ModelFactory.php | 6 +- .../2014_10_12_000000_create_users_table.php | 2 +- ...12_100000_create_password_resets_table.php | 2 +- .../2016_04_11_113117_update_users_table.php | 4 +- public/index.php | 3 +- resources/lang/en/auth.php | 2 +- resources/lang/en/passwords.php | 8 +-- server.php | 4 +- tests/ExampleTest.php | 3 - 33 files changed, 193 insertions(+), 179 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 71c519d..755c284 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -19,7 +19,8 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule + * @param \Illuminate\Console\Scheduling\Schedule $schedule + * * @return void */ protected function schedule(Schedule $schedule) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 53617ef..020664d 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,11 +3,11 @@ namespace App\Exceptions; use Exception; -use Illuminate\Validation\ValidationException; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Database\Eloquent\ModelNotFoundException; -use Symfony\Component\HttpKernel\Exception\HttpException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; +use Illuminate\Validation\ValidationException; +use Symfony\Component\HttpKernel\Exception\HttpException; class Handler extends ExceptionHandler { @@ -28,7 +28,8 @@ class Handler extends ExceptionHandler * * This is a great spot to send exceptions to Sentry, Bugsnag, etc. * - * @param \Exception $e + * @param \Exception $e + * * @return void */ public function report(Exception $e) @@ -39,8 +40,9 @@ public function report(Exception $e) /** * Render an exception into an HTTP response. * - * @param \Illuminate\Http\Request $request - * @param \Exception $e + * @param \Illuminate\Http\Request $request + * @param \Exception $e + * * @return \Illuminate\Http\Response */ public function render($request, Exception $e) diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index a85368e..e898c06 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -2,16 +2,16 @@ namespace App\Http\Controllers\Auth; +use App\Http\Controllers\Controller; use App\User; use Auth; use Authy; use FlashAlert; -use Validator; -use App\Http\Controllers\Controller; use Illuminate\Contracts\Auth\Authenticatable; -use Illuminate\Http\Request; -use Illuminate\Foundation\Auth\ThrottlesLogins; use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; +use Illuminate\Foundation\Auth\ThrottlesLogins; +use Illuminate\Http\Request; +use Validator; class AuthController extends Controller { @@ -48,8 +48,9 @@ public function __construct() /** * Send the post-authentication response. * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Contracts\Auth\Authenticatable $user + * @param \Illuminate\Http\Request $request + * @param \Illuminate\Contracts\Auth\Authenticatable $user + * * @return \Illuminate\Http\Response */ protected function authenticated(Request $request, Authenticatable $user) @@ -66,7 +67,8 @@ protected function authenticated(Request $request, Authenticatable $user) /** * Handle a registration request for the application. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function register(Request $request) @@ -87,7 +89,7 @@ public function register(Request $request) } /** - * Show two-factor authentication page + * Show two-factor authentication page. * * @return \Illuminate\Http\Response|\Illuminate\View\View */ @@ -99,21 +101,22 @@ public function getToken() /** * Verify the two-factor authentication token. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function postToken(Request $request) { $this->validate($request, ['token' => 'required']); - if (! session('authy:auth:id')) { + if (!session('authy:auth:id')) { return redirect(url('login')); } $guard = config('auth.defaults.guard'); - $provider = config('auth.guards.' . $guard . '.provider'); - $model = config('auth.providers.' . $provider . '.model'); + $provider = config('auth.guards.'.$guard.'.provider'); + $model = config('auth.providers.'.$provider.'.model'); - $user = (new $model)->findOrFail( + $user = (new $model())->findOrFail( $request->session()->pull('authy:auth:id') ); @@ -133,8 +136,9 @@ public function postToken(Request $request) /** * Generate a redirect response to the two-factor token screen. * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Contracts\Auth\Authenticatable $user + * @param \Illuminate\Http\Request $request + * @param \Illuminate\Contracts\Auth\Authenticatable $user + * * @return \Illuminate\Http\Response */ protected function logoutAndRedirectToTokenScreen(Request $request, Authenticatable $user) @@ -163,14 +167,15 @@ public function logout() /** * Get a validator for an incoming registration request. * - * @param array $data + * @param array $data + * * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) { return Validator::make($data, [ - 'name' => 'required|max:255', - 'email' => 'required|email|max:255|unique:users', + 'name' => 'required|max:255', + 'email' => 'required|email|max:255|unique:users', 'password' => 'required|min:6|confirmed', ]); } @@ -178,14 +183,15 @@ protected function validator(array $data) /** * Create a new user instance after a valid registration. * - * @param array $data + * @param array $data + * * @return User */ protected function create(array $data) { return User::create([ - 'name' => $data['name'], - 'email' => $data['email'], + 'name' => $data['name'], + 'email' => $data['email'], 'password' => bcrypt($data['password']), ]); } diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php index 9b9d31f..cc58602 100644 --- a/app/Http/Controllers/Auth/TwoFactorController.php +++ b/app/Http/Controllers/Auth/TwoFactorController.php @@ -2,14 +2,13 @@ namespace App\Http\Controllers\Auth; -use Illuminate\Http\Request; +use App\Http\Controllers\Controller; use Auth; use Authy; use Exception; use FlashAlert; +use Illuminate\Http\Request; use Validator; -use App\Http\Requests; -use App\Http\Controllers\Controller; class TwoFactorController extends Controller { @@ -19,14 +18,15 @@ public function __construct() } /** - * Enable two-factor authentication + * Enable two-factor authentication. * * @param \Illuminate\Http\Request $request + * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|null */ public function postEnable(Request $request) { - if (! is_null($response = $this->validateEnablingTwoFactorAuth($request))) { + if (!is_null($response = $this->validateEnablingTwoFactorAuth($request))) { return redirect(url('home'))->withErrors($response); } @@ -40,8 +40,9 @@ public function postEnable(Request $request) // Check if the user wants to receive token via SMS $sms = false; - if (!empty($input['sms'])) + if (!empty($input['sms'])) { $sms = true; + } try { Authy::getProvider()->register($user, $sms); @@ -61,7 +62,8 @@ public function postEnable(Request $request) /** * Validate an incoming request to enable two-factor authentication. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response|null */ protected function validateEnablingTwoFactorAuth(Request $request) @@ -73,7 +75,7 @@ protected function validateEnablingTwoFactorAuth(Request $request) } $validator = Validator::make($input, [ - 'country-code' => 'required|numeric|integer', + 'country-code' => 'required|numeric|integer', 'authy-cellphone' => 'required|numeric', ]); @@ -83,9 +85,10 @@ protected function validateEnablingTwoFactorAuth(Request $request) } /** - * Disable two-factor authentication + * Disable two-factor authentication. * * @param \Illuminate\Http\Request $request + * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|nul */ public function postDisable(Request $request) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index d492e0b..a6d01a7 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -2,11 +2,11 @@ namespace App\Http\Controllers; -use Illuminate\Foundation\Bus\DispatchesJobs; -use Illuminate\Routing\Controller as BaseController; -use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesResources; +use Illuminate\Foundation\Bus\DispatchesJobs; +use Illuminate\Foundation\Validation\ValidatesRequests; +use Illuminate\Routing\Controller as BaseController; class Controller extends BaseController { diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 5d4c1f8..a3ad3b4 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -2,7 +2,6 @@ namespace App\Http\Controllers; -use App\Http\Requests; use Auth; use Authy; use Illuminate\Http\Request; @@ -23,6 +22,7 @@ public function __construct() * Show the application dashboard. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function index(Request $request) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index bffcfd9..b9ee990 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -44,10 +44,10 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => \App\Http\Middleware\Authenticate::class, + 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'can' => \Illuminate\Foundation\Http\Middleware\Authorize::class, - 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, - 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + 'can' => \Illuminate\Foundation\Http\Middleware\Authorize::class, + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, ]; } diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 67abcae..84754b1 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -10,9 +10,10 @@ class Authenticate /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard + * * @return mixed */ public function handle($request, Closure $next, $guard = null) diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index e27860e..abb8423 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -10,9 +10,10 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard + * * @return mixed */ public function handle($request, Closure $next, $guard = null) diff --git a/app/Http/routes.php b/app/Http/routes.php index 70347ed..6d8297b 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -17,9 +17,9 @@ Route::auth(); -Route::get('auth/token','Auth\AuthController@getToken'); -Route::post('auth/token','Auth\AuthController@postToken'); -Route::post('auth/twofactor/enable','Auth\TwoFactorController@postEnable'); -Route::post('auth/twofactor/disable','Auth\TwoFactorController@postDisable'); +Route::get('auth/token', 'Auth\AuthController@getToken'); +Route::post('auth/token', 'Auth\AuthController@postToken'); +Route::post('auth/twofactor/enable', 'Auth\TwoFactorController@postEnable'); +Route::post('auth/twofactor/disable', 'Auth\TwoFactorController@postDisable'); Route::get('/home', 'HomeController@index'); diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 57d88ea..aaafb9c 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -19,7 +19,8 @@ class AuthServiceProvider extends ServiceProvider /** * Register any application authentication / authorization services. * - * @param \Illuminate\Contracts\Auth\Access\Gate $gate + * @param \Illuminate\Contracts\Auth\Access\Gate $gate + * * @return void */ public function boot(GateContract $gate) diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 58ce962..da6be08 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -21,7 +21,8 @@ class EventServiceProvider extends ServiceProvider /** * Register any other events for your application. * - * @param \Illuminate\Contracts\Events\Dispatcher $events + * @param \Illuminate\Contracts\Events\Dispatcher $events + * * @return void */ public function boot(DispatcherContract $events) diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index bde0881..fa9eb73 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Routing\Router; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; +use Illuminate\Routing\Router; class RouteServiceProvider extends ServiceProvider { @@ -19,7 +19,8 @@ class RouteServiceProvider extends ServiceProvider /** * Define your route model bindings, pattern filters, etc. * - * @param \Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router + * * @return void */ public function boot(Router $router) @@ -32,7 +33,8 @@ public function boot(Router $router) /** * Define the routes for the application. * - * @param \Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router + * * @return void */ public function map(Router $router) @@ -47,7 +49,8 @@ public function map(Router $router) * * These routes all receive session state, CSRF protection, etc. * - * @param \Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router + * * @return void */ protected function mapWebRoutes(Router $router) diff --git a/config/app.php b/config/app.php index d1e902f..79861b1 100644 --- a/config/app.php +++ b/config/app.php @@ -158,7 +158,7 @@ Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, Srmklive\Authy\Providers\AuthyServiceProvider::class, - Srmklive\FlashAlert\FlashAlertServiceProvider::class, + Srmklive\FlashAlert\FlashAlertServiceProvider::class, ], /* @@ -174,40 +174,40 @@ 'aliases' => [ - 'App' => Illuminate\Support\Facades\App::class, - 'Artisan' => Illuminate\Support\Facades\Artisan::class, - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Blade' => Illuminate\Support\Facades\Blade::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::class, - 'Request' => Illuminate\Support\Facades\Request::class, - 'Response' => Illuminate\Support\Facades\Response::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Schema' => Illuminate\Support\Facades\Schema::class, - 'Session' => Illuminate\Support\Facades\Session::class, - 'Storage' => Illuminate\Support\Facades\Storage::class, - 'URL' => Illuminate\Support\Facades\URL::class, + 'App' => Illuminate\Support\Facades\App::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'URL' => Illuminate\Support\Facades\URL::class, 'Validator' => Illuminate\Support\Facades\Validator::class, - 'View' => Illuminate\Support\Facades\View::class, + 'View' => Illuminate\Support\Facades\View::class, - 'Authy' => Srmklive\Authy\Facades\Authy::class, + 'Authy' => Srmklive\Authy\Facades\Authy::class, 'FlashAlert' => Srmklive\FlashAlert\Facades\FlashAlert::class, - + ], ]; diff --git a/config/auth.php b/config/auth.php index 3fa7f49..c678c87 100644 --- a/config/auth.php +++ b/config/auth.php @@ -14,7 +14,7 @@ */ 'defaults' => [ - 'guard' => 'web', + 'guard' => 'web', 'passwords' => 'users', ], @@ -37,12 +37,12 @@ 'guards' => [ 'web' => [ - 'driver' => 'session', + 'driver' => 'session', 'provider' => 'users', ], 'api' => [ - 'driver' => 'token', + 'driver' => 'token', 'provider' => 'users', ], ], @@ -67,7 +67,7 @@ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\User::class, + 'model' => App\User::class, ], // 'users' => [ @@ -98,9 +98,9 @@ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'email' => 'auth.emails.password', - 'table' => 'password_resets', - 'expire' => 60, + 'email' => 'auth.emails.password', + 'table' => 'password_resets', + 'expire' => 60, ], ], diff --git a/config/authy.php b/config/authy.php index 1222fe6..c6628fe 100644 --- a/config/authy.php +++ b/config/authy.php @@ -1,17 +1,18 @@ */ return [ - 'mode' => env('AUTHY_MODE', 'live'), // Can be either 'live' or 'sandbox'. If empty or invalid 'live' will be used + 'mode' => env('AUTHY_MODE', 'live'), // Can be either 'live' or 'sandbox'. If empty or invalid 'live' will be used 'sandbox' => [ - 'key' => env('AUTHY_TEST_KEY', '') + 'key' => env('AUTHY_TEST_KEY', ''), ], 'live' => [ - 'key' => env('AUTHY_LIVE_KEY', '') + 'key' => env('AUTHY_LIVE_KEY', ''), ], 'sms' => env('AUTHY_SEND_SMS', false), ]; diff --git a/config/broadcasting.php b/config/broadcasting.php index abaaac3..6207fd4 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -29,17 +29,17 @@ 'connections' => [ 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_KEY'), - 'secret' => env('PUSHER_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), + 'driver' => 'pusher', + 'key' => env('PUSHER_KEY'), + 'secret' => env('PUSHER_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), 'options' => [ // ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/cache.php b/config/cache.php index 3ffa840..8446b53 100644 --- a/config/cache.php +++ b/config/cache.php @@ -37,29 +37,29 @@ ], 'database' => [ - 'driver' => 'database', - 'table' => 'cache', + 'driver' => 'database', + 'table' => 'cache', 'connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache'), + 'path' => storage_path('framework/cache'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'servers' => [ [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100, ], ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/campaign_monitor.php b/config/campaign_monitor.php index e6fd2da..9a8dc41 100644 --- a/config/campaign_monitor.php +++ b/config/campaign_monitor.php @@ -1,9 +1,9 @@ + * Created by Raza Mehdi . */ return [ - 'api_key' => '', + 'api_key' => '', ]; diff --git a/config/database.php b/config/database.php index f5fc4ae..5a7e009 100644 --- a/config/database.php +++ b/config/database.php @@ -47,35 +47,35 @@ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => env('DB_DATABASE', storage_path('database.sqlite')), - 'prefix' => '', + 'prefix' => '', ], 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', + 'driver' => 'mysql', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', - 'prefix' => '', - 'strict' => false, - 'engine' => null, + 'prefix' => '', + 'strict' => false, + 'engine' => null, ], 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '5432'), + 'driver' => 'pgsql', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', ], ], @@ -109,9 +109,9 @@ 'cluster' => false, 'default' => [ - 'host' => env('REDIS_HOST', 'localhost'), + 'host' => env('REDIS_HOST', 'localhost'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', 6379), + 'port' => env('REDIS_PORT', 6379), 'database' => 0, ], diff --git a/config/filesystems.php b/config/filesystems.php index 75b5002..7d0d0ed 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -45,18 +45,18 @@ 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), + 'root' => storage_path('app'), ], 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), + 'driver' => 'local', + 'root' => storage_path('app/public'), 'visibility' => 'public', ], 's3' => [ 'driver' => 's3', - 'key' => 'your-key', + 'key' => 'your-key', 'secret' => 'your-secret', 'region' => 'your-region', 'bucket' => 'your-bucket', diff --git a/config/flashalert.php b/config/flashalert.php index ef39e26..15aa1c1 100644 --- a/config/flashalert.php +++ b/config/flashalert.php @@ -2,26 +2,26 @@ /** * FlashAlert Settings - * Created By Raza Mehdi + * Created By Raza Mehdi. */ return [ - /** + /* * Setting to determine whether session should be cleared after message is displayed to user. * Should be either true/false */ 'clear_session' => true, - /** + /* * Time after alert message to be hidden. * For example, if the alert message should be hidden after 2 seconds then the value below should be 2000 */ 'hide_timer' => 3000, - /** + /* * Setting to determine whether confirmation button should be shown. * Should be either true/false */ diff --git a/config/queue.php b/config/queue.php index d0f732a..9d61b73 100644 --- a/config/queue.php +++ b/config/queue.php @@ -36,32 +36,32 @@ 'database' => [ 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', + 'table' => 'jobs', + 'queue' => 'default', 'expire' => 60, ], 'beanstalkd' => [ 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'ttr' => 60, + 'host' => 'localhost', + 'queue' => 'default', + 'ttr' => 60, ], 'sqs' => [ 'driver' => 'sqs', - 'key' => 'your-public-key', + 'key' => 'your-public-key', 'secret' => 'your-secret-key', 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', - 'queue' => 'your-queue-name', + 'queue' => 'your-queue-name', 'region' => 'us-east-1', ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', - 'queue' => 'default', - 'expire' => 60, + 'queue' => 'default', + 'expire' => 60, ], ], @@ -79,7 +79,7 @@ 'failed' => [ 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', + 'table' => 'failed_jobs', ], ]; diff --git a/config/services.php b/config/services.php index 287b118..8b1ee8d 100644 --- a/config/services.php +++ b/config/services.php @@ -20,7 +20,7 @@ ], 'ses' => [ - 'key' => env('SES_KEY'), + 'key' => env('SES_KEY'), 'secret' => env('SES_SECRET'), 'region' => 'us-east-1', ], @@ -30,8 +30,8 @@ ], 'stripe' => [ - 'model' => App\User::class, - 'key' => env('STRIPE_KEY'), + 'model' => App\User::class, + 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), ], diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index f596d0b..dc62c20 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -13,9 +13,9 @@ $factory->define(App\User::class, function (Faker\Generator $faker) { return [ - 'name' => $faker->name, - 'email' => $faker->safeEmail, - 'password' => bcrypt(str_random(10)), + 'name' => $faker->name, + 'email' => $faker->safeEmail, + 'password' => bcrypt(str_random(10)), 'remember_token' => str_random(10), ]; }); diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 59aa01a..b04dbdc 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -1,7 +1,7 @@ dropColumn([ 'phone_country_code', 'phone_number', - 'two_factor_options' + 'two_factor_options', ]); }); } diff --git a/public/index.php b/public/index.php index c582053..fc6eb49 100644 --- a/public/index.php +++ b/public/index.php @@ -1,9 +1,8 @@ */ diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index e5506df..6ef1a73 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -13,7 +13,7 @@ | */ - 'failed' => 'These credentials do not match our records.', + 'failed' => 'These credentials do not match our records.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', ]; diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php index e5544d2..ffa19ba 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -14,9 +14,9 @@ */ 'password' => 'Passwords must be at least six characters and match the confirmation.', - 'reset' => 'Your password has been reset!', - 'sent' => 'We have e-mailed your password reset link!', - 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that e-mail address.", + 'reset' => 'Your password has been reset!', + 'sent' => 'We have e-mailed your password reset link!', + 'token' => 'This password reset token is invalid.', + 'user' => "We can't find a user with that e-mail address.", ]; diff --git a/server.php b/server.php index f65c7c4..1b4655b 100644 --- a/server.php +++ b/server.php @@ -1,12 +1,10 @@ */ - $uri = urldecode( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ); diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php index d2f129a..1308c5e 100644 --- a/tests/ExampleTest.php +++ b/tests/ExampleTest.php @@ -1,8 +1,5 @@