Permalink
Browse files

Continued linting and refinement of phpcs configuration

  • Loading branch information...
lovett committed Jul 4, 2016
1 parent 2303855 commit 8d5f2e010ed0ee31e8fb427ad4f7eb6b69669e67
@@ -2,18 +2,26 @@
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Closure;
/**
* Capture the current url to the sesion for future return
*/
class Returnable
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param Request $request The curent request.
* @param Closure $next The handler to receive the request.
*
* @return mixed
*/
public function handle($request, Closure $next)
public function handle(Request $request, Closure $next)
{
$response = $next($request);
@@ -4,14 +4,16 @@
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
/**
* Standard Laravel middleware for csrf verification
*/
class VerifyCsrfToken extends BaseVerifier
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
//
];
protected $except = [];
}
@@ -5,12 +5,17 @@
use App\Http\Requests\Request;
use Illuminate\Support\Facades\Auth;
/**
* Form request class for Projects
*/
class ClientRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
* @return boolean
*/
public function authorize()
{
@@ -29,25 +34,33 @@ public function rules()
];
}
/**
* Map validation rules to errors
*
* @return array
*/
public function messages()
{
return [
'required' => 'This field is required',
];
return ['required' => 'This field is required'];
}
/**
* Manipulate the input before performing validation
*
* @return Validator;
* @return Validator
*/
protected function getValidatorInstance()
{
// Set default values
collect(['active'])->each(function ($field) {
$value = $this->input($field, 0);
$this->merge([$field => $value]);
});
// Set default values.
collect(
['active']
)->each(
function ($field) {
$value = $this->input($field, 0);
$this->merge([$field => $value]);
}
);
return parent::getValidatorInstance();
}
@@ -8,18 +8,22 @@
use Illuminate\Support\Facades\Auth;
use Illuminate\Contracts\Validation\Validator;
/**
* Form request class for Projects
*/
class ProjectRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
* @return boolean
*/
public function authorize()
{
$projectId = $this->route('project');
$clientId = $this->input('client_id', 0);
$clientId = $this->input('client_id', 0);
$client = $this->user()->clients()->findOrFail($clientId);
@@ -43,29 +47,42 @@ public function rules()
'client_id' => 'numeric|required',
'active' => 'boolean',
'billable' => 'boolean',
'tax_deducted' => 'boolean',
'taxDeducted' => 'boolean',
];
}
/**
* Map validation rules to errors
*
* @return array
*/
public function messages()
{
return [
'required' => 'This field is required',
];
return ['required' => 'This field is required'];
}
/**
* Manipulate the input before performing validation
*
* @return Validator;
*/
protected function getValidatorInstance()
{
// Set default values
collect(['active', 'billable', 'tax_deducted'])->each(function ($field) {
$value = $this->input($field, 0);
$this->merge([$field => $value]);
});
// Set default values.
collect(
[
'active',
'billable',
'tax_deducted',
]
)->each(
function ($field) {
$value = $this->input($field, 0);
$this->merge([$field => $value]);
}
);
return parent::getValidatorInstance();
}
@@ -4,7 +4,9 @@
use Illuminate\Foundation\Http\FormRequest;
/**
* Standard Larave request class
*/
abstract class Request extends FormRequest
{
//
}
View
@@ -1,43 +1,47 @@
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
return view('welcome');
});
// Dashboard
Route::get('dashboard', [
'middleware' => 'auth',
'uses' => 'DashboardController@index'
]);
// Authentication
/**
* Application routes
*/
// Homepage.
Route::get(
'/',
function () {
return view('welcome');
}
);
// Dashboard.
Route::get(
'dashboard',
[
'middleware' => 'auth',
'uses' => 'DashboardController@index'
]
);
// Authentication.
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');
// Registration
// Registration.
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');
// Clients
// Clients.
Route::resource('client', 'ClientController', ['middleware' => 'auth']);
Route::get('clients', ['as' => 'clients', 'uses' => 'ClientController@index']);
// Projects
// Projects.
Route::resource('project', 'ProjectController');
Route::get('projects', ['as' => 'projects', 'uses' => 'ProjectController@index']);
// Time
Route::get(
'projects',
[
'as' => 'projects',
'uses' => 'ProjectController@index'
]
);
// Time.
Route::resource('time', 'TimeController', ['middleware' => 'auth']);
//Route::get('time', ['as' => 'time', 'uses' => 'TimeController@index']);
View
@@ -4,18 +4,14 @@
use Illuminate\Bus\Queueable;
/**
* Standard Laravel job class
*
* This job base class provides a central location to place any logic that
* is shared across all of your jobs. The trait included with the class
* provides access to the "onQueue" and "delay" queue helper methods.
*/
abstract class Job
{
/*
|--------------------------------------------------------------------------
| Queueable Jobs
|--------------------------------------------------------------------------
|
| This job base class provides a central location to place any logic that
| is shared across all of your jobs. The trait included with the class
| provides access to the "onQueue" and "delay" queue helper methods.
|
*/
use Queueable;
}
Oops, something went wrong.

0 comments on commit 8d5f2e0

Please sign in to comment.