@@ -12,12 +12,12 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('employee_groups', function (Blueprint $table) { |
|
| 15 | + Schema::create('employee_groups', function(Blueprint $table) { |
|
| 16 | 16 | $table->integer('employee_id')->unsigned(); |
| 17 | 17 | $table->foreign('employee_id')->references('id')->on('employees')->onDelete('cascade')->onUpdate('cascade'); |
| 18 | 18 | $table->integer('group_id')->unsigned(); |
| 19 | 19 | $table->foreign('group_id')->references('id')->on('groups')->onDelete('cascade')->onUpdate('cascade'); |
| 20 | - $table->unique(['employee_id', 'group_id']); |
|
| 20 | + $table->unique([ 'employee_id', 'group_id' ]); |
|
| 21 | 21 | }); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -33,14 +33,14 @@ |
||
| 33 | 33 | |
| 34 | 34 | static private function company() |
| 35 | 35 | { |
| 36 | - factory(plunner\Company::class, 10)->create()->each(function ($company) { |
|
| 36 | + factory(plunner\Company::class, 10)->create()->each(function($company) { |
|
| 37 | 37 | self::employees($company); |
| 38 | 38 | }); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static private function employees($company) |
| 42 | 42 | { |
| 43 | - factory(plunner\Employee::class, 3)->make()->each(function ($employee) use($company){ |
|
| 43 | + factory(plunner\Employee::class, 3)->make()->each(function($employee) use($company){ |
|
| 44 | 44 | $company->employees()->save($employee); |
| 45 | 45 | }); |
| 46 | 46 | } |
@@ -104,6 +104,6 @@ |
||
| 104 | 104 | | |
| 105 | 105 | */ |
| 106 | 106 | |
| 107 | - 'attributes' => [], |
|
| 107 | + 'attributes' => [ ], |
|
| 108 | 108 | |
| 109 | 109 | ]; |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | $uri = urldecode( |
| 11 | - parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) |
|
| 11 | + parse_url($_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH) |
|
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the |
@@ -3,8 +3,6 @@ |
||
| 3 | 3 | namespace plunner\Http\Controllers\Employees; |
| 4 | 4 | |
| 5 | 5 | use Illuminate\Http\Request; |
| 6 | - |
|
| 7 | -use plunner\Http\Requests; |
|
| 8 | 6 | use plunner\Http\Controllers\Controller; |
| 9 | 7 | |
| 10 | 8 | class GroupsController extends Controller |
@@ -51,14 +51,14 @@ |
||
| 51 | 51 | * |
| 52 | 52 | * @var array |
| 53 | 53 | */ |
| 54 | - protected $fillable = ['name', 'email', 'password']; |
|
| 54 | + protected $fillable = [ 'name', 'email', 'password' ]; |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * The attributes excluded from the model's JSON form. |
| 58 | 58 | * |
| 59 | 59 | * @var array |
| 60 | 60 | */ |
| 61 | - protected $hidden = ['password', 'remember_token']; |
|
| 61 | + protected $hidden = [ 'password', 'remember_token' ]; |
|
| 62 | 62 | |
| 63 | 63 | public function company() |
| 64 | 64 | { |
@@ -12,11 +12,11 @@ |
||
| 12 | 12 | | |
| 13 | 13 | */ |
| 14 | 14 | 'supportsCredentials' => false, |
| 15 | - 'allowedOrigins' => ['*'], |
|
| 16 | - 'allowedHeaders' => ['*'], |
|
| 17 | - 'allowedMethods' => ['GET', 'POST', 'PUT', 'DELETE'], |
|
| 18 | - 'exposedHeaders' => ['authorization'], |
|
| 15 | + 'allowedOrigins' => [ '*' ], |
|
| 16 | + 'allowedHeaders' => [ '*' ], |
|
| 17 | + 'allowedMethods' => [ 'GET', 'POST', 'PUT', 'DELETE' ], |
|
| 18 | + 'exposedHeaders' => [ 'authorization' ], |
|
| 19 | 19 | 'maxAge' => 0, |
| 20 | - 'hosts' => [], |
|
| 20 | + 'hosts' => [ ], |
|
| 21 | 21 | ]; |
| 22 | 22 | |
@@ -3,8 +3,6 @@ |
||
| 3 | 3 | namespace plunner\Http\Controllers\Employees; |
| 4 | 4 | |
| 5 | 5 | use Illuminate\Http\Request; |
| 6 | - |
|
| 7 | -use plunner\Http\Requests; |
|
| 8 | 6 | use plunner\Http\Controllers\Controller; |
| 9 | 7 | |
| 10 | 8 | class GroupsController extends Controller |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public function __construct() |
| 22 | 22 | { |
| 23 | - config(['auth.model' => \plunner\Company::class]); |
|
| 24 | - config(['jwt.user' => \plunner\Company::class]); |
|
| 23 | + config([ 'auth.model' => \plunner\Company::class ]); |
|
| 24 | + config([ 'jwt.user' => \plunner\Company::class ]); |
|
| 25 | 25 | $this->middleware('jwt.authandrefresh:mode-cn'); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -18,58 +18,58 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Companies |
| 20 | 20 | */ |
| 21 | -Route::group(['namespace' => 'Companies', 'prefix' => 'companies'], function() { |
|
| 21 | +Route::group([ 'namespace' => 'Companies', 'prefix' => 'companies' ], function() { |
|
| 22 | 22 | |
| 23 | 23 | //\Auth |
| 24 | 24 | |
| 25 | - Route::group(['namespace' => 'Auth'], function() { |
|
| 26 | - Route::group(['prefix' => 'auth'], function () { |
|
| 25 | + Route::group([ 'namespace' => 'Auth' ], function() { |
|
| 26 | + Route::group([ 'prefix' => 'auth' ], function() { |
|
| 27 | 27 | // Authentication routes... |
| 28 | - Route::post('login', ['as' => 'companies.auth.login','uses'=>'AuthController@postLogin']); |
|
| 28 | + Route::post('login', [ 'as' => 'companies.auth.login', 'uses'=>'AuthController@postLogin' ]); |
|
| 29 | 29 | |
| 30 | 30 | // Registration routes... |
| 31 | - Route::post('register', ['as' => 'companies.auth.register', 'uses'=>'AuthController@postRegister']); |
|
| 31 | + Route::post('register', [ 'as' => 'companies.auth.register', 'uses'=>'AuthController@postRegister' ]); |
|
| 32 | 32 | |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | - Route::group(['prefix' => 'password'], function () { |
|
| 35 | + Route::group([ 'prefix' => 'password' ], function() { |
|
| 36 | 36 | // Password reset link request routes... |
| 37 | - Route::post('email', ['as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail']); |
|
| 37 | + Route::post('email', [ 'as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail' ]); |
|
| 38 | 38 | |
| 39 | 39 | // Password reset routes... |
| 40 | - Route::post('reset', ['as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset']); |
|
| 40 | + Route::post('reset', [ 'as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset' ]); |
|
| 41 | 41 | }); |
| 42 | 42 | }); |
| 43 | 43 | |
| 44 | 44 | Route::resource('employees', 'EmployeesController'); |
| 45 | 45 | |
| 46 | 46 | //example |
| 47 | - Route::resource('example', 'ExampleController', ['except' => ['create', 'edit']]); |
|
| 47 | + Route::resource('example', 'ExampleController', [ 'except' => [ 'create', 'edit' ] ]); |
|
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Employees |
| 53 | 53 | */ |
| 54 | -Route::group(['namespace' => 'Employees', 'prefix' => 'employees'], function() { |
|
| 54 | +Route::group([ 'namespace' => 'Employees', 'prefix' => 'employees' ], function() { |
|
| 55 | 55 | //\Auth |
| 56 | 56 | |
| 57 | - Route::group(['namespace' => 'Auth'], function() { |
|
| 58 | - Route::group(['prefix' => 'auth'], function () { |
|
| 57 | + Route::group([ 'namespace' => 'Auth' ], function() { |
|
| 58 | + Route::group([ 'prefix' => 'auth' ], function() { |
|
| 59 | 59 | // Authentication routes... |
| 60 | - Route::post('login', ['as' => 'companies.auth.login', 'uses'=>'AuthController@postLogin']); |
|
| 60 | + Route::post('login', [ 'as' => 'companies.auth.login', 'uses'=>'AuthController@postLogin' ]); |
|
| 61 | 61 | |
| 62 | 62 | // Registration routes... |
| 63 | 63 | //Route::post('register', ['as' => 'companies.auth.register', 'uses'=>'AuthController@postRegister']); //the registration is managed by the company |
| 64 | 64 | |
| 65 | 65 | }); |
| 66 | 66 | |
| 67 | - Route::group(['prefix' => 'password'], function () { |
|
| 67 | + Route::group([ 'prefix' => 'password' ], function() { |
|
| 68 | 68 | // Password reset link request routes... |
| 69 | - Route::post('email', ['as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail']); |
|
| 69 | + Route::post('email', [ 'as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail' ]); |
|
| 70 | 70 | |
| 71 | 71 | // Password reset routes... |
| 72 | - Route::post('reset', ['as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset']); |
|
| 72 | + Route::post('reset', [ 'as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset' ]); |
|
| 73 | 73 | }); |
| 74 | 74 | }); |
| 75 | 75 | |