@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Homepage |
| 4 | -Route::get('/', function () { |
|
| 4 | +Route::get('/', function() { |
|
| 5 | 5 | return view('users.index'); |
| 6 | 6 | }); |
| 7 | 7 | |
| 8 | 8 | // Terms page |
| 9 | -Route::get('/terms', function () { |
|
| 9 | +Route::get('/terms', function() { |
|
| 10 | 10 | return view('static.terms'); |
| 11 | 11 | }); |
| 12 | 12 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | // Current User Account page |
| 23 | 23 | Route::get('/searches', 'SearchesController@index')->middleware('auth'); |
| 24 | 24 | |
| 25 | -Route::group(['prefix' => 'auth'], function () { |
|
| 25 | +Route::group([ 'prefix' => 'auth' ], function() { |
|
| 26 | 26 | // Submit login form (part 1 of login) |
| 27 | 27 | Route::post('/login', 'AuthController@login'); |
| 28 | 28 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | Route::get('/confirm/{token}', 'AuthController@confirm'); |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | -Route::group(['prefix' => 'users'], function () { |
|
| 36 | +Route::group([ 'prefix' => 'users' ], function() { |
|
| 37 | 37 | // Create new user |
| 38 | 38 | Route::post('/', 'UsersController@create'); |
| 39 | 39 | |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | Route::get('/{userId}/searches', 'SearchesController@index'); |
| 45 | 45 | }); |
| 46 | 46 | |
| 47 | -Route::group(['prefix' => 'searches'], function () { |
|
| 47 | +Route::group([ 'prefix' => 'searches' ], function() { |
|
| 48 | 48 | // Unsubscribe by ID |
| 49 | 49 | Route::get('/{searchId}/unsubscribe', 'SearchesController@unsubscribe'); |
| 50 | 50 | }); |
| 51 | 51 | |
| 52 | -Route::group(['prefix' => 'collections'], function () { |
|
| 52 | +Route::group([ 'prefix' => 'collections' ], function() { |
|
| 53 | 53 | // Download jobs from a collection |
| 54 | 54 | Route::get('/{id}/download', 'CollectionsController@download'); |
| 55 | 55 | }); |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php namespace JobApis\JobsToMail\Models; |
| 2 | 2 | |
| 3 | 3 | use Illuminate\Database\Eloquent\Model; |
| 4 | -use Illuminate\Support\Facades\DB; |
|
| 5 | 4 | use Ramsey\Uuid\Uuid; |
| 6 | 5 | |
| 7 | 6 | class Recruiter extends Model |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | parent::boot(); |
| 32 | 32 | |
| 33 | - static::creating(function ($model) { |
|
| 33 | + static::creating(function($model) { |
|
| 34 | 34 | $model->{$model->getKeyName()} = Uuid::uuid4(); |
| 35 | 35 | }); |
| 36 | 36 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | if ($name) { |
| 49 | 49 | $where = "to_tsvector('english', name) @@ plainto_tsquery('english', ?)"; |
| 50 | - return $query->whereRaw($where, [$name]); |
|
| 50 | + return $query->whereRaw($where, [ $name ]); |
|
| 51 | 51 | } |
| 52 | 52 | return $query; |
| 53 | 53 | } |
@@ -3,10 +3,10 @@ discard block |
||
| 3 | 3 | /** |
| 4 | 4 | * Makes a best guess at the server's IP defaulting to localhost. |
| 5 | 5 | */ |
| 6 | -if (isset($_SERVER['REMOTE_ADDR'])) { |
|
| 7 | - $currentIp = $_SERVER['REMOTE_ADDR']; |
|
| 8 | -} elseif (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) { |
|
| 9 | - $ipAddresses = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); |
|
| 6 | +if (isset($_SERVER[ 'REMOTE_ADDR' ])) { |
|
| 7 | + $currentIp = $_SERVER[ 'REMOTE_ADDR' ]; |
|
| 8 | +} elseif (isset($_SERVER[ "HTTP_X_FORWARDED_FOR" ])) { |
|
| 9 | + $ipAddresses = explode(',', $_SERVER[ 'HTTP_X_FORWARDED_FOR' ]); |
|
| 10 | 10 | $currentIp = trim(end($ipAddresses)); |
| 11 | 11 | } else { |
| 12 | 12 | $currentIp = '127.0.0.1'; |
@@ -15,20 +15,19 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Makes a best guess at the user agent making this request |
| 17 | 17 | */ |
| 18 | -$userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : |
|
| 19 | - 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'; |
|
| 18 | +$userAgent = isset($_SERVER[ 'HTTP_USER_AGENT' ]) ? $_SERVER[ 'HTTP_USER_AGENT' ] : 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'; |
|
| 20 | 19 | |
| 21 | 20 | /** |
| 22 | 21 | * Default job boards that require no API key permissions |
| 23 | 22 | */ |
| 24 | 23 | $jobboards = [ |
| 25 | - 'Careercast' => [], |
|
| 26 | - 'Dice' => [], |
|
| 27 | - 'Github' => [], |
|
| 28 | - 'Govt' => [], |
|
| 29 | - 'Ieee' => [], |
|
| 30 | - 'Jobinventory' => [], |
|
| 31 | - 'Stackoverflow' => [], |
|
| 24 | + 'Careercast' => [ ], |
|
| 25 | + 'Dice' => [ ], |
|
| 26 | + 'Github' => [ ], |
|
| 27 | + 'Govt' => [ ], |
|
| 28 | + 'Ieee' => [ ], |
|
| 29 | + 'Jobinventory' => [ ], |
|
| 30 | + 'Stackoverflow' => [ ], |
|
| 32 | 31 | ]; |
| 33 | 32 | |
| 34 | 33 | /** |
@@ -36,7 +35,7 @@ discard block |
||
| 36 | 35 | * http://developer.careerbuilder.com/ |
| 37 | 36 | */ |
| 38 | 37 | if (env("CAREERBUILDER_KEY")) { |
| 39 | - $jobboards['Careerbuilder'] = [ |
|
| 38 | + $jobboards[ 'Careerbuilder' ] = [ |
|
| 40 | 39 | 'DeveloperKey' => env("CAREERBUILDER_KEY"), |
| 41 | 40 | ]; |
| 42 | 41 | } |
@@ -45,7 +44,7 @@ discard block |
||
| 45 | 44 | * http://www.careerjet.com/partners/ |
| 46 | 45 | */ |
| 47 | 46 | if (env("CAREERJET_KEY")) { |
| 48 | - $jobboards['Careerjet'] = [ |
|
| 47 | + $jobboards[ 'Careerjet' ] = [ |
|
| 49 | 48 | 'affid' => env("CAREERJET_KEY"), |
| 50 | 49 | ]; |
| 51 | 50 | } |
@@ -54,7 +53,7 @@ discard block |
||
| 54 | 53 | * http://www.indeed.com/publisher |
| 55 | 54 | */ |
| 56 | 55 | if (env("INDEED_KEY")) { |
| 57 | - $jobboards['Indeed'] = [ |
|
| 56 | + $jobboards[ 'Indeed' ] = [ |
|
| 58 | 57 | 'publisher' => env("INDEED_KEY"), |
| 59 | 58 | 'userip' => $currentIp, |
| 60 | 59 | 'useragent' => $userAgent, |
@@ -65,7 +64,7 @@ discard block |
||
| 65 | 64 | * https://developer.usajobs.gov/Search-API/Overview |
| 66 | 65 | */ |
| 67 | 66 | if (env("USAJOBS_KEY")) { |
| 68 | - $jobboards['Usajobs'] = [ |
|
| 67 | + $jobboards[ 'Usajobs' ] = [ |
|
| 69 | 68 | 'AuthorizationKey' => env("USAJOBS_KEY"), |
| 70 | 69 | ]; |
| 71 | 70 | } |
@@ -74,7 +73,7 @@ discard block |
||
| 74 | 73 | * http://www.juju.com/publisher/spec/ |
| 75 | 74 | */ |
| 76 | 75 | if (env("JUJU_KEY")) { |
| 77 | - $jobboards['Juju'] = [ |
|
| 76 | + $jobboards[ 'Juju' ] = [ |
|
| 78 | 77 | 'partnerid' => env("JUJU_KEY"), |
| 79 | 78 | 'ipaddress' => $currentIp, |
| 80 | 79 | 'useragent' => $userAgent, |
@@ -86,7 +85,7 @@ discard block |
||
| 86 | 85 | * https://www.ziprecruiter.com/publishers |
| 87 | 86 | */ |
| 88 | 87 | if (env("ZIPRECRUITER_KEY")) { |
| 89 | - $jobboards['Ziprecruiter'] = [ |
|
| 88 | + $jobboards[ 'Ziprecruiter' ] = [ |
|
| 90 | 89 | 'api_key' => env("ZIPRECRUITER_KEY"), |
| 91 | 90 | ]; |
| 92 | 91 | } |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php namespace JobApis\JobsToMail\Jobs; |
| 2 | 2 | |
| 3 | 3 | use Illuminate\Bus\Queueable; |
| 4 | -use Illuminate\Queue\SerializesModels; |
|
| 5 | -use Illuminate\Queue\InteractsWithQueue; |
|
| 6 | 4 | use Illuminate\Contracts\Queue\ShouldQueue; |
| 5 | +use Illuminate\Queue\InteractsWithQueue; |
|
| 6 | +use Illuminate\Queue\SerializesModels; |
|
| 7 | 7 | use Illuminate\Support\Facades\Log; |
| 8 | -use JobApis\Jobs\Client\JobsMulti; |
|
| 9 | 8 | use JobApis\JobsToMail\Models\User; |
| 10 | 9 | use JobApis\JobsToMail\Notifications\JobsCollected; |
| 10 | +use JobApis\Jobs\Client\JobsMulti; |
|
| 11 | 11 | |
| 12 | 12 | class CollectJobsForUser implements ShouldQueue |
| 13 | 13 | { |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * @var array Jobs collected from providers. |
| 22 | 22 | */ |
| 23 | - protected $jobs = []; |
|
| 23 | + protected $jobs = [ ]; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * @var Recruiter recruiter model |
@@ -21,7 +21,6 @@ |
||
| 21 | 21 | /** |
| 22 | 22 | * Unsubscribe from a search by deleting it. |
| 23 | 23 | * |
| 24 | - * @param SearchRepositoryInterface $users |
|
| 25 | 24 | * |
| 26 | 25 | * @return FlashMessage |
| 27 | 26 | */ |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * Create a new job instance. |
| 17 | 17 | */ |
| 18 | - public function __construct($data = []) |
|
| 18 | + public function __construct($data = [ ]) |
|
| 19 | 19 | { |
| 20 | 20 | $this->data = $data; |
| 21 | 21 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::table('users', function (Blueprint $table) { |
|
| 16 | + Schema::table('users', function(Blueprint $table) { |
|
| 17 | 17 | $table->string('tier')->default(config('app.user_tiers.free')); |
| 18 | 18 | $table->dropColumn('keyword'); |
| 19 | 19 | $table->dropColumn('location'); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function down() |
| 29 | 29 | { |
| 30 | - Schema::table('users', function (Blueprint $table) { |
|
| 30 | + Schema::table('users', function(Blueprint $table) { |
|
| 31 | 31 | $table->string('keyword')->nullable(); |
| 32 | 32 | $table->string('location')->nullable(); |
| 33 | 33 | $table->dropColumn('tier'); |
@@ -34,11 +34,11 @@ |
||
| 34 | 34 | \JobApis\JobsToMail\Repositories\UserRepository::class |
| 35 | 35 | ); |
| 36 | 36 | // Job board API client |
| 37 | - $this->app->bind(JobsMulti::class, function () { |
|
| 37 | + $this->app->bind(JobsMulti::class, function() { |
|
| 38 | 38 | return new JobsMulti(config('jobboards')); |
| 39 | 39 | }); |
| 40 | 40 | // CSV Writer |
| 41 | - $this->app->bind('League\Csv\Writer', function () { |
|
| 41 | + $this->app->bind('League\Csv\Writer', function() { |
|
| 42 | 42 | return Writer::createFromString(''); |
| 43 | 43 | }); |
| 44 | 44 | } |