diff --git a/.env.example b/.env.example index 031862bef64..86aab15fbe8 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,10 @@ APP_ENV=local APP_DEBUG=true APP_KEY=SomeRandomString +APP_URL=http://localhost -DB_HOST=localhost +DB_HOST=127.0.0.1 +DB_PORT=3306 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret @@ -11,7 +13,7 @@ CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync -REDIS_HOST=localhost +REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 diff --git a/.gitignore b/.gitignore index 2ff24d0f291..6b3af3fee63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /vendor /node_modules +/public/storage Homestead.yaml Homestead.json .env diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 5e4a31b2d8f..71c519d3277 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel * @var array */ protected $commands = [ - Commands\Inspire::class, + // Commands\Inspire::class, ]; /** @@ -24,7 +24,7 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - $schedule->command('inspire') - ->hourly(); + // $schedule->command('inspire') + // ->hourly(); } } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 3dabc68cb26..53617ef4adc 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,9 +3,10 @@ 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 Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; class Handler extends ExceptionHandler @@ -16,8 +17,10 @@ class Handler extends ExceptionHandler * @var array */ protected $dontReport = [ + AuthorizationException::class, HttpException::class, ModelNotFoundException::class, + ValidationException::class, ]; /** @@ -30,7 +33,7 @@ class Handler extends ExceptionHandler */ public function report(Exception $e) { - return parent::report($e); + parent::report($e); } /** @@ -42,10 +45,6 @@ public function report(Exception $e) */ public function render($request, Exception $e) { - if ($e instanceof ModelNotFoundException) { - $e = new NotFoundHttpException($e->getMessage(), $e); - } - return parent::render($request, $e); } } diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index c0ad3b8ee65..a100dd6ef3f 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -23,6 +23,13 @@ class AuthController extends Controller use AuthenticatesAndRegistersUsers, ThrottlesLogins; + /** + * Where to redirect users after login / registration. + * + * @var string + */ + protected $redirectTo = '/'; + /** * Create a new authentication controller instance. * @@ -30,7 +37,7 @@ class AuthController extends Controller */ public function __construct() { - $this->middleware('guest', ['except' => 'getLogout']); + $this->middleware($this->guestMiddleware(), ['except' => 'logout']); } /** @@ -44,7 +51,7 @@ protected function validator(array $data) return Validator::make($data, [ 'name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', - 'password' => 'required|confirmed|min:6', + 'password' => 'required|min:6|confirmed', ]); } diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 4eb37d58b22..03e02a23e29 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -7,7 +7,7 @@ use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; -abstract class Controller extends BaseController +class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index ceea60a7a9e..f0d8083cea3 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -9,25 +9,44 @@ class Kernel extends HttpKernel /** * The application's global HTTP middleware stack. * + * These middleware are run during every request to your application. + * * @var array */ protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, - \App\Http\Middleware\EncryptCookies::class, - \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, - \Illuminate\Session\Middleware\StartSession::class, - \Illuminate\View\Middleware\ShareErrorsFromSession::class, - \App\Http\Middleware\VerifyCsrfToken::class, + ]; + + /** + * The application's route middleware groups. + * + * @var array + */ + protected $middlewareGroups = [ + 'web' => [ + \App\Http\Middleware\EncryptCookies::class, + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, + \Illuminate\Session\Middleware\StartSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \App\Http\Middleware\VerifyCsrfToken::class, + ], + + 'api' => [ + 'throttle:60,1', + ], ]; /** * The application's route middleware. * + * These middleware may be assigned to groups or used individually. + * * @var array */ protected $routeMiddleware = [ 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::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 a5ef9c69349..67abcaea917 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -3,42 +3,25 @@ namespace App\Http\Middleware; use Closure; -use Illuminate\Contracts\Auth\Guard; +use Illuminate\Support\Facades\Auth; class Authenticate { - /** - * The Guard implementation. - * - * @var Guard - */ - protected $auth; - - /** - * Create a new middleware instance. - * - * @param Guard $auth - * @return void - */ - public function __construct(Guard $auth) - { - $this->auth = $auth; - } - /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next + * @param string|null $guard * @return mixed */ - public function handle($request, Closure $next) + public function handle($request, Closure $next, $guard = null) { - if ($this->auth->guest()) { - if ($request->ajax()) { + if (Auth::guard($guard)->guest()) { + if ($request->ajax() || $request->wantsJson()) { return response('Unauthorized.', 401); } else { - return redirect()->guest('auth/login'); + return redirect()->guest('login'); } } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index c85f9e508c7..e27860e24ed 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -3,38 +3,21 @@ namespace App\Http\Middleware; use Closure; -use Illuminate\Contracts\Auth\Guard; +use Illuminate\Support\Facades\Auth; class RedirectIfAuthenticated { - /** - * The Guard implementation. - * - * @var Guard - */ - protected $auth; - - /** - * Create a new filter instance. - * - * @param Guard $auth - * @return void - */ - public function __construct(Guard $auth) - { - $this->auth = $auth; - } - /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next + * @param string|null $guard * @return mixed */ - public function handle($request, Closure $next) + public function handle($request, Closure $next, $guard = null) { - if ($this->auth->check()) { + if (Auth::guard($guard)->check()) { return redirect('/'); } diff --git a/app/Listeners/.gitkeep b/app/Listeners/.gitkeep index e69de29bb2d..8b137891791 100644 --- a/app/Listeners/.gitkeep +++ b/app/Listeners/.gitkeep @@ -0,0 +1 @@ + diff --git a/app/Policies/.gitkeep b/app/Policies/.gitkeep index e69de29bb2d..8b137891791 100644 --- a/app/Policies/.gitkeep +++ b/app/Policies/.gitkeep @@ -0,0 +1 @@ + diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index d50b1c0f8d6..bde08819a90 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -8,7 +8,7 @@ class RouteServiceProvider extends ServiceProvider { /** - * This namespace is applied to the controller routes in your routes file. + * This namespace is applied to your controller routes. * * In addition, it is set as the URL generator's root namespace. * @@ -37,7 +37,24 @@ public function boot(Router $router) */ public function map(Router $router) { - $router->group(['namespace' => $this->namespace], function ($router) { + $this->mapWebRoutes($router); + + // + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @param \Illuminate\Routing\Router $router + * @return void + */ + protected function mapWebRoutes(Router $router) + { + $router->group([ + 'namespace' => $this->namespace, 'middleware' => 'web', + ], function ($router) { require app_path('Http/routes.php'); }); } diff --git a/app/User.php b/app/User.php index 9f1e7481a3b..75741ae4285 100644 --- a/app/User.php +++ b/app/User.php @@ -2,38 +2,25 @@ namespace App; -use Illuminate\Auth\Authenticatable; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Auth\Passwords\CanResetPassword; -use Illuminate\Foundation\Auth\Access\Authorizable; -use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; -use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; -use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; +use Illuminate\Foundation\Auth\User as Authenticatable; -class User extends Model implements AuthenticatableContract, - AuthorizableContract, - CanResetPasswordContract +class User extends Authenticatable { - use Authenticatable, Authorizable, CanResetPassword; - - /** - * The database table used by the model. - * - * @var string - */ - protected $table = 'users'; - /** * The attributes that are mass assignable. * * @var array */ - protected $fillable = ['name', 'email', 'password']; + protected $fillable = [ + 'name', 'email', 'password', + ]; /** - * The attributes excluded from the model's JSON form. + * The attributes that should be hidden for arrays. * * @var array */ - protected $hidden = ['password', 'remember_token']; + protected $hidden = [ + 'password', 'remember_token', + ]; } diff --git a/composer.json b/composer.json index a6ced5e2f92..f51662842a2 100644 --- a/composer.json +++ b/composer.json @@ -6,13 +6,14 @@ "type": "project", "require": { "php": ">=5.5.9", - "laravel/framework": "5.1.*" + "laravel/framework": "5.2.*" }, "require-dev": { "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", "phpunit/phpunit": "~4.0", - "phpspec/phpspec": "~2.1" + "symfony/css-selector": "2.8.*|3.0.*", + "symfony/dom-crawler": "2.8.*|3.0.*" }, "autoload": { "classmap": [ @@ -28,21 +29,19 @@ ] }, "scripts": { + "post-root-package-install": [ + "php -r \"copy('.env.example', '.env');\"" + ], + "post-create-project-cmd": [ + "php artisan key:generate" + ], "post-install-cmd": [ "php artisan clear-compiled", "php artisan optimize" ], - "pre-update-cmd": [ - "php artisan clear-compiled" - ], "post-update-cmd": [ + "php artisan clear-compiled", "php artisan optimize" - ], - "post-root-package-install": [ - "php -r \"copy('.env.example', '.env');\"" - ], - "post-create-project-cmd": [ - "php artisan key:generate" ] }, "config": { diff --git a/config/app.php b/config/app.php index 036282a6bb7..4fc7a63ffea 100644 --- a/config/app.php +++ b/config/app.php @@ -2,6 +2,19 @@ return [ + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services your application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + /* |-------------------------------------------------------------------------- | Application Debug Mode @@ -26,7 +39,7 @@ | */ - 'url' => 'http://localhost', + 'url' => env('APP_URL', 'http://localhost'), /* |-------------------------------------------------------------------------- @@ -78,7 +91,7 @@ | */ - 'key' => env('APP_KEY', 'SomeRandomString'), + 'key' => env('APP_KEY'), 'cipher' => 'AES-256-CBC', @@ -113,13 +126,11 @@ /* * Laravel Framework Service Providers... */ - Illuminate\Foundation\Providers\ArtisanServiceProvider::class, Illuminate\Auth\AuthServiceProvider::class, Illuminate\Broadcasting\BroadcastServiceProvider::class, Illuminate\Bus\BusServiceProvider::class, Illuminate\Cache\CacheServiceProvider::class, Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, - Illuminate\Routing\ControllerServiceProvider::class, Illuminate\Cookie\CookieServiceProvider::class, Illuminate\Database\DatabaseServiceProvider::class, Illuminate\Encryption\EncryptionServiceProvider::class, @@ -160,38 +171,36 @@ '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, - 'Bus' => Illuminate\Support\Facades\Bus::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, - 'Input' => Illuminate\Support\Facades\Input::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, ], diff --git a/config/auth.php b/config/auth.php index 99d06307f55..3fa7f491b30 100644 --- a/config/auth.php +++ b/config/auth.php @@ -4,64 +4,104 @@ /* |-------------------------------------------------------------------------- - | Default Authentication Driver + | Authentication Defaults |-------------------------------------------------------------------------- | - | This option controls the authentication driver that will be utilized. - | This driver manages the retrieval and authentication of the users - | attempting to get access to protected areas of your application. - | - | Supported: "database", "eloquent" + | This option controls the default authentication "guard" and password + | reset options for your application. You may change these defaults + | as required, but they're a perfect start for most applications. | */ - 'driver' => 'eloquent', + 'defaults' => [ + 'guard' => 'web', + 'passwords' => 'users', + ], /* |-------------------------------------------------------------------------- - | Authentication Model + | Authentication Guards |-------------------------------------------------------------------------- | - | When using the "Eloquent" authentication driver, we need to know which - | Eloquent model should be used to retrieve your users. Of course, it - | is often just the "User" model but you may use whatever you like. + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" | */ - 'model' => App\User::class, + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + + 'api' => [ + 'driver' => 'token', + 'provider' => 'users', + ], + ], /* |-------------------------------------------------------------------------- - | Authentication Table + | User Providers |-------------------------------------------------------------------------- | - | When using the "Database" authentication driver, we need to know which - | table should be used to retrieve your users. We have chosen a basic - | default value but you may easily change it to any table you like. + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" | */ - 'table' => 'users', + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => App\User::class, + ], + + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], /* |-------------------------------------------------------------------------- - | Password Reset Settings + | Resetting Passwords |-------------------------------------------------------------------------- | | Here you may set the options for resetting passwords including the view - | that is your password reset e-mail. You can also set the name of the + | that is your password reset e-mail. You may also set the name of the | table that maintains all of the reset tokens for your application. | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | separate password reset settings based on the specific user types. + | | The expire time is the number of minutes that the reset token should be | considered valid. This security feature keeps tokens short-lived so | they have less time to be guessed. You may change this as needed. | */ - 'password' => [ - 'email' => 'emails.password', - 'table' => 'password_resets', - 'expire' => 60, + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'email' => 'auth.emails.password', + 'table' => 'password_resets', + 'expire' => 60, + ], ], ]; diff --git a/config/cache.php b/config/cache.php index 379135b0eb6..3ffa840b0ba 100644 --- a/config/cache.php +++ b/config/cache.php @@ -38,20 +38,22 @@ 'database' => [ 'driver' => 'database', - 'table' => 'cache', + 'table' => 'cache', 'connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache'), + 'path' => storage_path('framework/cache'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'servers' => [ [ - 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100, + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, ], ], ], diff --git a/config/database.php b/config/database.php index 66e88a90903..def1e5600fd 100644 --- a/config/database.php +++ b/config/database.php @@ -47,42 +47,35 @@ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => database_path('database.sqlite'), - 'prefix' => '', + 'prefix' => '', ], 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST', 'localhost'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'collation' => 'utf8_unicode_ci', - 'prefix' => '', - 'strict' => false, - ], - - 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', 'localhost'), + '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', - 'prefix' => '', - 'schema' => 'public', + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + 'strict' => false, + 'engine' => null, ], - 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'host' => env('DB_HOST', 'localhost'), + 'pgsql' => [ + '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' => '', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', ], ], @@ -116,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 3fffcf0a2fd..75b50022b0c 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -45,41 +45,23 @@ 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), + 'root' => storage_path('app'), ], - 'ftp' => [ - 'driver' => 'ftp', - 'host' => 'ftp.example.com', - 'username' => 'your-username', - 'password' => 'your-password', - - // Optional FTP Settings... - // 'port' => 21, - // 'root' => '', - // 'passive' => true, - // 'ssl' => true, - // 'timeout' => 30, + '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', ], - 'rackspace' => [ - 'driver' => 'rackspace', - 'username' => 'your-username', - 'key' => 'your-key', - 'container' => 'your-container', - 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/', - 'region' => 'IAD', - 'url_type' => 'publicURL', - ], - ], ]; diff --git a/config/mail.php b/config/mail.php index fd5123c0678..a07658856c7 100644 --- a/config/mail.php +++ b/config/mail.php @@ -11,7 +11,8 @@ | sending of e-mail. You may specify which one you're using throughout | your application here. By default, Laravel is setup for SMTP mail. | - | Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "ses", "log" + | Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", + | "ses", "sparkpost", "log" | */ @@ -108,17 +109,4 @@ 'sendmail' => '/usr/sbin/sendmail -bs', - /* - |-------------------------------------------------------------------------- - | Mail "Pretend" - |-------------------------------------------------------------------------- - | - | When this option is enabled, e-mail will not actually be sent over the - | web and will instead be written to your application's logs files so - | you may inspect the message. This is great for local development. - | - */ - - 'pretend' => env('MAIL_PRETEND', false), - ]; diff --git a/config/queue.php b/config/queue.php index 9d30238ea20..a2f3888c6f9 100644 --- a/config/queue.php +++ b/config/queue.php @@ -12,7 +12,7 @@ | syntax for each one. Here you may set the default queue driver. | | Supported: "null", "sync", "database", "beanstalkd", - | "sqs", "iron", "redis" + | "sqs", "redis" | */ @@ -37,40 +37,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', - 'queue' => 'your-queue-url', + 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', + 'queue' => 'your-queue-name', 'region' => 'us-east-1', ], - 'iron' => [ - 'driver' => 'iron', - 'host' => 'mq-aws-us-east-1.iron.io', - 'token' => 'your-token', - 'project' => 'your-project-id', - 'queue' => 'your-queue-name', - 'encrypt' => true, - ], - 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', - 'queue' => 'default', - 'expire' => 60, + 'queue' => 'default', + 'expire' => 60, ], ], @@ -88,7 +80,7 @@ 'failed' => [ 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', + 'table' => 'failed_jobs', ], ]; diff --git a/config/services.php b/config/services.php index 93eec863655..287b1186229 100644 --- a/config/services.php +++ b/config/services.php @@ -19,19 +19,19 @@ 'secret' => env('MAILGUN_SECRET'), ], - 'mandrill' => [ - 'secret' => env('MANDRILL_SECRET'), - ], - 'ses' => [ - 'key' => env('SES_KEY'), + 'key' => env('SES_KEY'), 'secret' => env('SES_SECRET'), 'region' => 'us-east-1', ], + 'sparkpost' => [ + 'secret' => env('SPARKPOST_SECRET'), + ], + 'stripe' => [ - 'model' => App\User::class, - 'key' => env('STRIPE_KEY'), + 'model' => App\User::class, + 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), ], diff --git a/config/session.php b/config/session.php index f1b004214a4..b501055b275 100644 --- a/config/session.php +++ b/config/session.php @@ -150,4 +150,17 @@ 'secure' => false, + /* + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. You are free to modify this option if needed. + | + */ + + 'http_only' => true, + ]; diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 0876c70c74f..f596d0b59b5 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -14,7 +14,7 @@ $factory->define(App\User::class, function (Faker\Generator $faker) { return [ 'name' => $faker->name, - 'email' => $faker->email, + 'email' => $faker->safeEmail, 'password' => bcrypt(str_random(10)), 'remember_token' => str_random(10), ]; diff --git a/database/migrations/.gitkeep b/database/migrations/.gitkeep index e69de29bb2d..8b137891791 100644 --- a/database/migrations/.gitkeep +++ b/database/migrations/.gitkeep @@ -0,0 +1 @@ + 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 65d3d083882..59aa01a5591 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -16,7 +16,7 @@ public function up() $table->increments('id'); $table->string('name'); $table->string('email')->unique(); - $table->string('password', 60); + $table->string('password'); $table->rememberToken(); $table->timestamps(); }); diff --git a/database/seeds/.gitkeep b/database/seeds/.gitkeep index e69de29bb2d..8b137891791 100644 --- a/database/seeds/.gitkeep +++ b/database/seeds/.gitkeep @@ -0,0 +1 @@ + diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 988ea210051..e119db624aa 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -1,7 +1,6 @@ call(UserTableSeeder::class); - - Model::reguard(); + // $this->call(UsersTableSeeder::class); } } diff --git a/phpspec.yml b/phpspec.yml deleted file mode 100644 index eb57939e570..00000000000 --- a/phpspec.yml +++ /dev/null @@ -1,5 +0,0 @@ -suites: - main: - namespace: App - psr4_prefix: App - src_path: app \ No newline at end of file diff --git a/public/.htaccess b/public/.htaccess index 8eb2dd0ddfa..903f6392ca4 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -13,4 +13,8 @@ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] diff --git a/public/web.config b/public/web.config index 2da2a959788..624c1760fcb 100644 --- a/public/web.config +++ b/public/web.config @@ -15,7 +15,7 @@ - + diff --git a/readme.md b/readme.md index f67a6cf7cef..7f8816d62ad 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -## Laravel PHP Framework +# Laravel PHP Framework [![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework) [![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.svg)](https://packagist.org/packages/laravel/framework) @@ -8,7 +8,7 @@ Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, queueing, and caching. -Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked. +Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked. ## Official Documentation @@ -22,6 +22,6 @@ Thank you for considering contributing to the Laravel framework! The contributio If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed. -### License +## License -The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) +The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index b0a1f143588..b1e612044f1 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -34,11 +34,13 @@ 'different' => 'The :attribute and :other must be different.', 'digits' => 'The :attribute must be :digits digits.', 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'distinct' => 'The :attribute field has a duplicate value.', 'email' => 'The :attribute must be a valid email address.', 'exists' => 'The selected :attribute is invalid.', 'filled' => 'The :attribute field is required.', 'image' => 'The :attribute must be an image.', 'in' => 'The selected :attribute is invalid.', + 'in_array' => 'The :attribute field does not exist in :other.', 'integer' => 'The :attribute must be an integer.', 'ip' => 'The :attribute must be a valid IP address.', 'json' => 'The :attribute must be a valid JSON string.', @@ -57,6 +59,7 @@ ], 'not_in' => 'The selected :attribute is invalid.', 'numeric' => 'The :attribute must be a number.', + 'present' => 'The :attribute field must be present.', 'regex' => 'The :attribute format is invalid.', 'required' => 'The :attribute field is required.', 'required_if' => 'The :attribute field is required when :other is :value.', diff --git a/resources/views/vendor/.gitkeep b/resources/views/vendor/.gitkeep index e69de29bb2d..8b137891791 100644 --- a/resources/views/vendor/.gitkeep +++ b/resources/views/vendor/.gitkeep @@ -0,0 +1 @@ + diff --git a/storage/app/.gitignore b/storage/app/.gitignore index c96a04f008e..8f4803c0563 100644 --- a/storage/app/.gitignore +++ b/storage/app/.gitignore @@ -1,2 +1,3 @@ * -!.gitignore \ No newline at end of file +!public/ +!.gitignore diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore new file mode 100644 index 00000000000..d6b7ef32c84 --- /dev/null +++ b/storage/app/public/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore index 953edb7a993..b02b700f1bf 100644 --- a/storage/framework/.gitignore +++ b/storage/framework/.gitignore @@ -1,5 +1,6 @@ config.php routes.php +schedule-* compiled.php services.json events.scanned.php diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore index c96a04f008e..d6b7ef32c84 100644 --- a/storage/framework/cache/.gitignore +++ b/storage/framework/cache/.gitignore @@ -1,2 +1,2 @@ * -!.gitignore \ No newline at end of file +!.gitignore