Compare commits

...

4 Commits
master ... 5.2

Author SHA1 Message Date
Taylor Otwell 1f74747cd3 Merge pull request #3 from absemetov/patch-1
10 years ago
Nadir Absemetov 536eb3bb1c Old input name
10 years ago
Taylor Otwell 9ff73afab3 use model binding
10 years ago
Taylor Otwell e04f3ff8cc update to 5.2
10 years ago

@ -3,8 +3,9 @@
namespace App\Exceptions; namespace App\Exceptions;
use Exception; use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Auth\Access\AuthorizationException;
use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
@ -16,8 +17,10 @@ class Handler extends ExceptionHandler
* @var array * @var array
*/ */
protected $dontReport = [ protected $dontReport = [
AuthorizationException::class,
HttpException::class, HttpException::class,
ModelNotFoundException::class, ModelNotFoundException::class,
ValidationException::class,
]; ];
/** /**
@ -42,10 +45,6 @@ class Handler extends ExceptionHandler
*/ */
public function render($request, Exception $e) public function render($request, Exception $e)
{ {
if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
}
return parent::render($request, $e); return parent::render($request, $e);
} }
} }

@ -13,11 +13,25 @@ class Kernel extends HttpKernel
*/ */
protected $middleware = [ protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class, \App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class, \Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class, \App\Http\Middleware\VerifyCsrfToken::class,
],
'api' => [
'throttle:60,1',
],
]; ];
/** /**
@ -29,5 +43,6 @@ class Kernel extends HttpKernel
'auth' => \App\Http\Middleware\Authenticate::class, 'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
]; ];
} }

@ -14,6 +14,8 @@
use App\Task; use App\Task;
use Illuminate\Http\Request; use Illuminate\Http\Request;
Route::group(['middleware' => 'web'], function () {
/** /**
* Show Task Dashboard * Show Task Dashboard
*/ */
@ -49,8 +51,10 @@ Route::post('/task', function (Request $request) {
/** /**
* Delete Task * Delete Task
*/ */
Route::delete('/task/{id}', function ($id) { Route::delete('/task/{task}', function (Task $task) {
Task::findOrFail($id)->delete(); $task->delete();
return redirect('/'); return redirect('/');
}); });
});

@ -6,7 +6,9 @@
"type": "project", "type": "project",
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
"laravel/framework": "5.1.*" "laravel/framework": "5.2.*",
"symfony/dom-crawler": "^3.0",
"symfony/css-selector": "^3.0"
}, },
"require-dev": { "require-dev": {
"fzaninotto/faker": "~1.4", "fzaninotto/faker": "~1.4",
@ -45,6 +47,7 @@
"php artisan key:generate" "php artisan key:generate"
] ]
}, },
"minimum-stability": "dev",
"config": { "config": {
"preferred-install": "dist" "preferred-install": "dist"
} }

974
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -2,6 +2,19 @@
return [ 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 | Application Debug Mode
@ -119,7 +132,6 @@ return [
Illuminate\Bus\BusServiceProvider::class, Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class, Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Routing\ControllerServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class, Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class, Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class, Illuminate\Encryption\EncryptionServiceProvider::class,
@ -164,7 +176,6 @@ return [
'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class, 'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class, 'Blade' => Illuminate\Support\Facades\Blade::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class, 'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class, 'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class, 'Cookie' => Illuminate\Support\Facades\Cookie::class,

@ -4,64 +4,104 @@ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Authentication Driver | Authentication Defaults
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This option controls the authentication driver that will be utilized. | This option controls the default authentication "guard" and password
| This driver manages the retrieval and authentication of the users | reset options for your application. You may change these defaults
| attempting to get access to protected areas of your application. | as required, but they're a perfect start for most applications.
|
| Supported: "database", "eloquent"
| |
*/ */
'driver' => 'eloquent', 'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Authentication Model | Authentication Guards
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| When using the "Eloquent" authentication driver, we need to know which | Next, you may define every authentication guard for your application.
| Eloquent model should be used to retrieve your users. Of course, it | Of course, a great default configuration has been defined for you
| is often just the "User" model but you may use whatever you like. | 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 | All authentication drivers have a user provider. This defines how the
| table should be used to retrieve your users. We have chosen a basic | users are actually retrieved out of your database or other storage
| default value but you may easily change it to any table you like. | 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 | 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. | 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
| seperate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be | The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so | considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed. | they have less time to be guessed. You may change this as needed.
| |
*/ */
'password' => [ 'passwords' => [
'email' => 'emails.password', 'users' => [
'provider' => 'users',
'email' => 'auth.emails.password',
'table' => 'password_resets', 'table' => 'password_resets',
'expire' => 60, 'expire' => 60,
], ],
],
]; ];

@ -21,7 +21,7 @@
<label for="task-name" class="col-sm-3 control-label">Task</label> <label for="task-name" class="col-sm-3 control-label">Task</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" name="name" id="task-name" class="form-control" value="{{ old('task') }}"> <input type="text" name="name" id="task-name" class="form-control" value="{{ old('name') }}">
</div> </div>
</div> </div>

Loading…
Cancel
Save