diff --git a/.env.example b/.env.example index abf3cf1..0b54595 100644 --- a/.env.example +++ b/.env.example @@ -1,37 +1,44 @@ -SITE_NAME="Hypothetical Template" -SITE_DESC="A website template" +SITE_NAME='Hypothetical Template' +SITE_DESC='A website template' APP_ENV=local APP_DEBUG=true -APP_KEY=random_string +APP_LOG_LEVEL=debug APP_URL=http://localhost +APP_KEY= CACHE_BUST= LR_HOST=localhost -DB_HOST=localhost +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 DB_DATABASE=hypothetical DB_USERNAME=homestead DB_PASSWORD=secret -COOKIE_NAME=hypothetical - +CACHE_NAME=hypothetical CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync -MAILCHIMP_APIKEY= -MAILCHIMP_LISTID= - -MAIL_SENDTO=null +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 MAIL_DRIVER=smtp MAIL_HOST=null MAIL_PORT=587 -MAIL_ADDRESS=null MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=tls +MAIL_SENDFROM=null +MAIL_SENDTO=null + +COOKIE_NAME=hypothetical + +MAILCHIMP_APIKEY= +MAILCHIMP_LISTID= REGISTRATION=true diff --git a/.gitattributes b/.gitattributes index 95883de..a8763f8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ * text=auto *.css linguist-vendored -*.less linguist-vendored +*.scss linguist-vendored diff --git a/.gitignore b/.gitignore index 7ca4a96..f487747 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ /vendor /node_modules /bower_components +/public/storage /public/css /public/js /public/fonts /public/uploads /storage/exports -.env +/.idea +/.env diff --git a/app/Console/Commands/Inspire.php b/app/Console/Commands/Inspire.php deleted file mode 100644 index db9ab85..0000000 --- a/app/Console/Commands/Inspire.php +++ /dev/null @@ -1,33 +0,0 @@ -comment(PHP_EOL.Inspiring::quote().PHP_EOL); - } -} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 71c519d..622e774 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, + // ]; /** @@ -27,4 +27,14 @@ class Kernel extends ConsoleKernel // $schedule->command('inspire') // ->hourly(); } + + /** + * Register the Closure based commands for the application. + * + * @return void + */ + protected function commands() + { + require base_path('routes/console.php'); + } } diff --git a/app/Events/Event.php b/app/Events/Event.php deleted file mode 100644 index ba2f888..0000000 --- a/app/Events/Event.php +++ /dev/null @@ -1,8 +0,0 @@ -expectsJson()) { + return response()->json(['error' => 'Unauthenticated.'], 401); + } + + return redirect()->guest('login'); } } diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php new file mode 100644 index 0000000..6a247fe --- /dev/null +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -0,0 +1,32 @@ +middleware('guest'); + } +} diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php new file mode 100644 index 0000000..3d7eed0 --- /dev/null +++ b/app/Http/Controllers/Auth/LoginController.php @@ -0,0 +1,39 @@ +middleware('guest', [ 'except' => 'logout' ]); + } +} diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/RegisterController.php similarity index 63% rename from app/Http/Controllers/Auth/AuthController.php rename to app/Http/Controllers/Auth/RegisterController.php index 690beb2..69c667e 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -5,23 +5,22 @@ namespace App\Http\Controllers\Auth; use App\User; use Validator; use App\Http\Controllers\Controller; -use Illuminate\Foundation\Auth\ThrottlesLogins; -use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; +use Illuminate\Foundation\Auth\RegistersUsers; -class AuthController extends Controller +class RegisterController extends Controller { /* |-------------------------------------------------------------------------- - | Registration & Login Controller + | Register Controller |-------------------------------------------------------------------------- | - | This controller handles the registration of new users, as well as the - | authentication of existing users. By default, this controller uses - | a simple trait to add these behaviors. Why don't you explore it? + | This controller handles the registration of new users as well as their + | validation and creation. By default this controller uses a trait to + | provide this functionality without requiring any additional code. | */ - use AuthenticatesAndRegistersUsers, ThrottlesLogins; + use RegistersUsers; /** * Where to redirect users after login / registration. @@ -31,13 +30,45 @@ class AuthController extends Controller protected $redirectTo = '/dashboard'; /** - * Create a new authentication controller instance. + * Create a new controller instance. * * @return void */ public function __construct() { - $this->middleware('guest', ['except' => 'logout']); + $this->middleware('guest'); + } + + /** + * Get a validator for an incoming registration request. + * + * @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', + 'password' => 'required|min:6|confirmed', + ]); + } + + /** + * Create a new user instance after a valid registration. + * + * @param array $data + * @return User + */ + protected function create(array $data) + { + if (env('REGISTRATION', false)) { + return User::create([ + 'name' => $data['name'], + 'email' => $data['email'], + 'password' => bcrypt($data['password']), + ]); + } } /** @@ -53,36 +84,4 @@ class AuthController extends Controller header('Location: /login'); } } - - /** - * Get a validator for an incoming registration request. - * - * @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', - 'password' => 'required|confirmed|min:6', - ]); - } - - /** - * Create a new user instance after a valid registration. - * - * @param array $data - * @return User - */ - protected function create(array $data) - { - if (env('REGISTRATION', false)) { - return User::create([ - 'name' => $data['name'], - 'email' => $data['email'], - 'password' => bcrypt($data['password']), - ]); - } - } } diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php similarity index 75% rename from app/Http/Controllers/Auth/PasswordController.php rename to app/Http/Controllers/Auth/ResetPasswordController.php index c84497c..c73bf99 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -5,7 +5,7 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; -class PasswordController extends Controller +class ResetPasswordController extends Controller { /* |-------------------------------------------------------------------------- @@ -21,14 +21,7 @@ class PasswordController extends Controller use ResetsPasswords; /** - * Where to redirect users after login / registration. - * - * @var string - */ - protected $redirectTo = '/dashboard'; - - /** - * Create a new password controller instance. + * Create a new controller instance. * * @return void */ diff --git a/app/Http/Controllers/ContactController.php b/app/Http/Controllers/ContactController.php index a35b9d3..f323398 100644 --- a/app/Http/Controllers/ContactController.php +++ b/app/Http/Controllers/ContactController.php @@ -27,7 +27,7 @@ class ContactController extends Controller { // Send the email if the MAIL_SENDTO variable is set if (env('MAIL_SENDTO') != null) { Mail::send('email.contact', [ 'contact' => $contact ], function($mail) use ($contact) { - $mail->from(env('MAIL_ADDRESS'), env('SITE_NAME')) + $mail->from(env('MAIL_SENDFROM'), env('SITE_NAME')) ->to(env('MAIL_SENDTO')) ->subject('Contact form submission'); }); diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 0538bfc..bcabec4 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -29,10 +29,12 @@ class Kernel extends HttpKernel \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, ], 'api' => [ 'throttle:60,1', + 'bindings', ], ]; @@ -44,9 +46,11 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => \App\Http\Middleware\Authenticate::class, + 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, - 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, + 'can' => \Illuminate\Auth\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 deleted file mode 100644 index ba1f1c3..0000000 --- a/app/Http/Middleware/Authenticate.php +++ /dev/null @@ -1,30 +0,0 @@ -guest()) { - if ($request->ajax()) { - return response('Unauthorized.', 401); - } else { - return redirect()->guest('/login'); - } - } - - return $next($request); - } -} diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.php deleted file mode 100644 index 76b2ffd..0000000 --- a/app/Http/Requests/Request.php +++ /dev/null @@ -1,10 +0,0 @@ - 'web'], function () { - /* - |-------------------------------------------------------------------------- - | Public Routes - |-------------------------------------------------------------------------- - */ - - Route::get('/', function() { - Head::setTitle('Home'); - return view('website.index'); - }); - - Route::get('/contact', function() { - Head::setTitle('Contact'); - return view('website.contact'); - }); - - /* - |-------------------------------------------------------------------------- - | Post Routes - |-------------------------------------------------------------------------- - */ - - Route::post('/contact-submit', 'ContactController@postContactSubmit'); - Route::post('/subscription-submit', 'SubscriptionController@postSubscriptionSubmit'); - - /* - |-------------------------------------------------------------------------- - | Authentication Routes - |-------------------------------------------------------------------------- - */ - - Route::auth(); - - /* - |-------------------------------------------------------------------------- - | Dashboard Routes - |-------------------------------------------------------------------------- - */ - - Route::group(['prefix' => 'dashboard'], function() { - Route::get('/', 'DashboardController@index'); - Route::controller('', DashboardController::class); - }); -}); diff --git a/app/Jobs/Job.php b/app/Jobs/Job.php deleted file mode 100644 index d99ae7e..0000000 --- a/app/Jobs/Job.php +++ /dev/null @@ -1,21 +0,0 @@ - 'App\Policies\ModelPolicy', + ]; + + /** + * Register any authentication / authorization services. + * + * @return void + */ + public function boot() + { + $this->registerPolicies(); + + // + } +} diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php new file mode 100644 index 0000000..1dcf8d2 --- /dev/null +++ b/app/Providers/BroadcastServiceProvider.php @@ -0,0 +1,26 @@ +id === (int) $userId; + }); + } +} diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 58ce962..a182657 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -2,7 +2,7 @@ namespace App\Providers; -use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; +use Illuminate\Support\Facades\Event; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; class EventServiceProvider extends ServiceProvider @@ -19,14 +19,13 @@ class EventServiceProvider extends ServiceProvider ]; /** - * Register any other events for your application. + * Register any events for your application. * - * @param \Illuminate\Contracts\Events\Dispatcher $events * @return void */ - public function boot(DispatcherContract $events) + public function boot() { - parent::boot($events); + parent::boot(); // } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index d50b1c0..057f82c 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -2,13 +2,13 @@ namespace App\Providers; -use Illuminate\Routing\Router; +use Illuminate\Support\Facades\Route; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; 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. * @@ -19,26 +19,61 @@ class RouteServiceProvider extends ServiceProvider /** * Define your route model bindings, pattern filters, etc. * - * @param \Illuminate\Routing\Router $router * @return void */ - public function boot(Router $router) + public function boot() { // - parent::boot($router); + parent::boot(); } /** * Define the routes for the application. * - * @param \Illuminate\Routing\Router $router * @return void */ - public function map(Router $router) + public function map() { - $router->group(['namespace' => $this->namespace], function ($router) { - require app_path('Http/routes.php'); + $this->mapWebRoutes(); + + $this->mapApiRoutes(); + + // + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::group([ + 'middleware' => 'web', + 'namespace' => $this->namespace, + ], function ($router) { + require base_path('routes/web.php'); + }); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::group([ + 'middleware' => ['api', 'auth:api'], + 'namespace' => $this->namespace, + 'prefix' => 'api', + ], function ($router) { + require base_path('routes/api.php'); }); } } diff --git a/app/User.php b/app/User.php index 27ff422..bfd96a6 100644 --- a/app/User.php +++ b/app/User.php @@ -1,8 +1,13 @@ -=5.5.9", - "laravel/framework": "5.2.*", + "php": ">=5.6.4", + "laravel/framework": "5.3.*", "radic/blade-extensions": "~6.2", "erusev/parsedown": "~1.5", "gwnobots/laravel-head": "dev-master", @@ -17,9 +17,9 @@ "require-dev": { "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", - "phpunit/phpunit": "~4.0", - "symfony/css-selector": "2.8.*|3.0.*", - "symfony/dom-crawler": "2.8.*|3.0.*" + "phpunit/phpunit": "~5.0", + "symfony/css-selector": "3.1.*", + "symfony/dom-crawler": "3.1.*" }, "autoload": { "classmap": [ @@ -36,21 +36,23 @@ }, "scripts": { "post-root-package-install": [ - "php -r \"copy('.env.example', '.env');\"" + "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "php artisan key:generate" ], "post-install-cmd": [ - "php artisan clear-compiled", + "Illuminate\\Foundation\\ComposerScripts::postInstall", "php artisan optimize" ], "post-update-cmd": [ - "php artisan clear-compiled", + "Illuminate\\Foundation\\ComposerScripts::postUpdate", "php artisan optimize" ] }, "config": { "preferred-install": "dist" - } + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/config/app.php b/config/app.php index d4f079e..8ff5629 100644 --- a/config/app.php +++ b/config/app.php @@ -2,6 +2,18 @@ return [ + /* + |-------------------------------------------------------------------------- + | Application Name + |-------------------------------------------------------------------------- + | + | This value is the name of your application. This value is used when the + | framework needs to place the application's name in a notification or + | any other location as required by the application or its packages. + */ + + 'name' => env('SITE_NAME', 'My Application'), + /* |-------------------------------------------------------------------------- | Application Environment @@ -110,6 +122,8 @@ return [ 'log' => 'single', + 'log_level' => env('APP_LOG_LEVEL', 'debug'), + /* |-------------------------------------------------------------------------- | Autoloaded Service Providers @@ -138,6 +152,7 @@ return [ Illuminate\Foundation\Providers\FoundationServiceProvider::class, Illuminate\Hashing\HashServiceProvider::class, Illuminate\Mail\MailServiceProvider::class, + Illuminate\Notifications\NotificationServiceProvider::class, Illuminate\Pagination\PaginationServiceProvider::class, Illuminate\Pipeline\PipelineServiceProvider::class, Illuminate\Queue\QueueServiceProvider::class, @@ -148,10 +163,15 @@ return [ Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, + /* + * Package Service Providers... + */ + /* * Application Service Providers... */ App\Providers\AppServiceProvider::class, + // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, @@ -179,35 +199,37 @@ return [ '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, - '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, + 'Notification' => Illuminate\Support\Facades\Notification::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, /* * Custom Class Aliases... diff --git a/config/auth.php b/config/auth.php index 3fa7f49..a57bdc7 100644 --- a/config/auth.php +++ b/config/auth.php @@ -98,7 +98,6 @@ return [ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'email' => 'auth.emails.password', 'table' => 'password_resets', 'expire' => 60, ], diff --git a/config/broadcasting.php b/config/broadcasting.php index 36f9b3c..19a59ba 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -11,9 +11,11 @@ return [ | framework when an event needs to be broadcast. You may set this to | any of the connections defined in the "connections" array below. | + | Supported: "pusher", "redis", "log", "null" + | */ - 'default' => env('BROADCAST_DRIVER', 'pusher'), + 'default' => env('BROADCAST_DRIVER', 'null'), /* |-------------------------------------------------------------------------- @@ -33,6 +35,9 @@ return [ 'key' => env('PUSHER_KEY'), 'secret' => env('PUSHER_SECRET'), 'app_id' => env('PUSHER_APP_ID'), + 'options' => [ + // + ], ], 'redis' => [ @@ -44,6 +49,10 @@ return [ 'driver' => 'log', ], + 'null' => [ + 'driver' => 'null', + ], + ], ]; diff --git a/config/cache.php b/config/cache.php index 379135b..444f01d 100644 --- a/config/cache.php +++ b/config/cache.php @@ -11,6 +11,8 @@ return [ | using this caching library. This connection is used when another is | not explicitly specified when executing a given caching function. | + | Supported: "apc", "array", "database", "file", "memcached", "redis" + | */ 'default' => env('CACHE_DRIVER', 'file'), @@ -38,20 +40,30 @@ return [ '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', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], '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, ], ], ], @@ -74,6 +86,6 @@ return [ | */ - 'prefix' => 'laravel', + 'prefix' => env('CACHE_NAME', 'laravel'), ]; diff --git a/config/database.php b/config/database.php index f6cf86b..fd22e8e 100644 --- a/config/database.php +++ b/config/database.php @@ -13,7 +13,7 @@ return [ | */ - 'fetch' => PDO::FETCH_CLASS, + 'fetch' => PDO::FETCH_OBJ, /* |-------------------------------------------------------------------------- @@ -47,42 +47,36 @@ return [ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', - 'database' => storage_path('database.sqlite'), - 'prefix' => '', + 'driver' => 'sqlite', + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + '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', + '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, + 'prefix' => '', + 'strict' => true, + 'engine' => null, ], 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', 'localhost'), + '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', - ], - - 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'host' => env('DB_HOST', 'localhost'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + 'sslmode' => 'prefer', ], ], @@ -116,8 +110,9 @@ return [ 'cluster' => false, 'default' => [ - 'host' => '127.0.0.1', - 'port' => 6379, + 'host' => env('REDIS_HOST', 'localhost'), + 'password' => env('REDIS_PASSWORD', null), + 'port' => env('REDIS_PORT', 6379), 'database' => 0, ], diff --git a/config/filesystems.php b/config/filesystems.php index 3fffcf0..75b5002 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -45,41 +45,23 @@ return [ '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 c94bb9d..f1a7e9a 100644 --- a/config/mail.php +++ b/config/mail.php @@ -11,7 +11,8 @@ return [ | 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" | */ @@ -54,7 +55,10 @@ return [ | */ - 'from' => ['address' => env('MAIL_ADDRESS', null), 'name' => env('SITE_NAME', null)], + 'from' => [ + 'address' => env('MAIL_SENDFROM', null), + 'name' => env('SITE_NAME', null), + ], /* |-------------------------------------------------------------------------- diff --git a/config/queue.php b/config/queue.php index 38fa540..549322e 100644 --- a/config/queue.php +++ b/config/queue.php @@ -11,8 +11,7 @@ return [ | API, giving you convenient access to each back-end using the same | syntax for each one. Here you may set the default queue driver. | - | Supported: "null", "sync", "database", "beanstalkd", - | "sqs", "redis" + | Supported: "sync", "database", "beanstalkd", "sqs", "redis", "null" | */ @@ -39,30 +38,30 @@ return [ 'driver' => 'database', 'table' => 'jobs', 'queue' => 'default', - 'expire' => 60, + 'retry_after' => 90, ], 'beanstalkd' => [ 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'ttr' => 60, + 'host' => 'localhost', + 'queue' => 'default', + 'retry_after' => 90, ], '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', 'connection' => 'default', - 'queue' => 'default', - 'expire' => 60, + 'queue' => 'default', + 'retry_after' => 90, ], ], @@ -79,7 +78,8 @@ return [ */ 'failed' => [ - 'database' => 'mysql', 'table' => 'failed_jobs', + 'database' => env('DB_CONNECTION', 'mysql'), + 'table' => 'failed_jobs', ], ]; diff --git a/config/services.php b/config/services.php index 51abbbd..4460f0e 100644 --- a/config/services.php +++ b/config/services.php @@ -8,31 +8,31 @@ return [ |-------------------------------------------------------------------------- | | This file is for storing the credentials for third party services such - | as Stripe, Mailgun, Mandrill, and others. This file provides a sane + | as Stripe, Mailgun, SparkPost and others. This file provides a sane | default location for this type of information, allowing packages | to have a conventional place to find your various credentials. | */ 'mailgun' => [ - 'domain' => '', - 'secret' => '', - ], - - 'mandrill' => [ - 'secret' => '', + 'domain' => env('MAILGUN_DOMAIN'), + 'secret' => env('MAILGUN_SECRET'), ], 'ses' => [ - 'key' => '', - 'secret' => '', + 'key' => env('SES_KEY'), + 'secret' => env('SES_SECRET'), 'region' => 'us-east-1', ], + 'sparkpost' => [ + 'secret' => env('SPARKPOST_SECRET'), + ], + 'stripe' => [ - 'model' => App\User::class, - 'key' => '', - 'secret' => '', + 'model' => App\User::class, + 'key' => env('STRIPE_KEY'), + 'secret' => env('STRIPE_SECRET'), ], ]; diff --git a/config/session.php b/config/session.php index 20fb26a..5503ee0 100644 --- a/config/session.php +++ b/config/session.php @@ -85,6 +85,19 @@ return [ 'table' => 'sessions', + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | When using the "apc" or "memcached" session drivers, you may specify a + | cache store that should be used for these sessions. This value must + | correspond with one of the application's configured cache stores. + | + */ + + 'store' => null, + /* |-------------------------------------------------------------------------- | Session Sweeping Lottery @@ -135,7 +148,7 @@ return [ | */ - 'domain' => null, + 'domain' => env('SESSION_DOMAIN', null), /* |-------------------------------------------------------------------------- @@ -150,4 +163,17 @@ return [ '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' => false, + ]; diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index ae7165b..f596d0b 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -11,11 +11,11 @@ | */ -$factory->define(App\User::class, function ($faker) { +$factory->define(App\User::class, function (Faker\Generator $faker) { return [ 'name' => $faker->name, - 'email' => $faker->email, - 'password' => str_random(10), + '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 65d3d08..55574ee 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -1,5 +1,6 @@ increments('id'); $table->string('name'); $table->string('email')->unique(); - $table->string('password', 60); + $table->string('password'); $table->rememberToken(); $table->timestamps(); }); diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php index 00057f9..bda733d 100644 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -1,5 +1,6 @@ string('email')->index(); $table->string('token')->index(); - $table->timestamp('created_at'); + $table->timestamp('created_at')->nullable(); }); } diff --git a/database/migrations/2015_12_14_200624_add_contact_table.php b/database/migrations/2015_12_14_200624_add_contact_table.php index 7eeae6b..aaf6438 100644 --- a/database/migrations/2015_12_14_200624_add_contact_table.php +++ b/database/migrations/2015_12_14_200624_add_contact_table.php @@ -1,5 +1,6 @@ + stopOnFailure="false"> - ./tests/ + ./tests - - app/ + + ./app diff --git a/public/.htaccess b/public/.htaccess index 8eb2dd0..903f639 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/index.php b/public/index.php index c582053..716731f 100644 --- a/public/index.php +++ b/public/index.php @@ -4,7 +4,7 @@ * Laravel - A PHP Framework For Web Artisans * * @package Laravel - * @author Taylor Otwell + * @author Taylor Otwell */ /* diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php new file mode 100644 index 0000000..e5506df --- /dev/null +++ b/resources/lang/en/auth.php @@ -0,0 +1,19 @@ + '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 7c10cba..e5544d2 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -4,7 +4,7 @@ return [ /* |-------------------------------------------------------------------------- - | Password Reminder Language Lines + | Password Reset Language Lines |-------------------------------------------------------------------------- | | The following language lines are the default lines which match reasons @@ -14,9 +14,9 @@ return [ */ 'password' => 'Passwords must be at least six characters and match the confirmation.', - 'user' => "We can't find a user with that e-mail address.", - 'token' => 'This password reset token is invalid.', - 'sent' => 'We have e-mailed your password reset link!', '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/resources/lang/en/validation.php b/resources/lang/en/validation.php index 20acc9a..28c6677 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -34,13 +34,18 @@ return [ '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.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', 'email' => 'The :attribute must be a valid email address.', - 'filled' => 'The :attribute field is required.', 'exists' => 'The selected :attribute is invalid.', + 'file' => 'The :attribute must be a file.', + '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.', 'max' => [ 'numeric' => 'The :attribute may not be greater than :max.', 'file' => 'The :attribute may not be greater than :max kilobytes.', @@ -56,9 +61,11 @@ return [ ], '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.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', 'required_with' => 'The :attribute field is required when :values is present.', 'required_with_all' => 'The :attribute field is required when :values is present.', 'required_without' => 'The :attribute field is required when :values is not present.', diff --git a/routes/api.php b/routes/api.php new file mode 100644 index 0000000..32f7cf7 --- /dev/null +++ b/routes/api.php @@ -0,0 +1,18 @@ +user(); +}); diff --git a/routes/console.php b/routes/console.php new file mode 100644 index 0000000..eea1a86 --- /dev/null +++ b/routes/console.php @@ -0,0 +1,18 @@ +comment(Inspiring::quote()); +}); diff --git a/routes/web.php b/routes/web.php new file mode 100644 index 0000000..a0a82c1 --- /dev/null +++ b/routes/web.php @@ -0,0 +1,45 @@ + 'dashboard'], function() { + Route::get('/', 'DashboardController@index'); + Route::controller('', DashboardController::class); +}); diff --git a/server.php b/server.php index f65c7c4..5fb6379 100644 --- a/server.php +++ b/server.php @@ -4,7 +4,7 @@ * Laravel - A PHP Framework For Web Artisans * * @package Laravel - * @author Taylor Otwell + * @author Taylor Otwell */ $uri = urldecode( diff --git a/storage/app/.gitignore b/storage/app/.gitignore index c96a04f..8f4803c 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 0000000..d6b7ef3 --- /dev/null +++ b/storage/app/public/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore index 953edb7..b02b700 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 c96a04f..d6b7ef3 100644 --- a/storage/framework/cache/.gitignore +++ b/storage/framework/cache/.gitignore @@ -1,2 +1,2 @@ * -!.gitignore \ No newline at end of file +!.gitignore diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php index 7e81d37..2f2d20f 100644 --- a/tests/ExampleTest.php +++ b/tests/ExampleTest.php @@ -14,6 +14,6 @@ class ExampleTest extends TestCase public function testBasicExample() { $this->visit('/') - ->see('Laravel 5'); + ->see('Laravel'); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index 8578b17..8208edc 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,6 +1,6 @@