Skip to content

Commit

Permalink
ran linter
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Dec 18, 2023
1 parent 9dabd44 commit 6a2bc61
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/Http/Controllers/Api/v1/OrganizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

namespace Fleetbase\Http\Controllers\Api\v1;

use Illuminate\Http\Request;
use Fleetbase\Http\Controllers\Controller;
use Fleetbase\Http\Resources\Organization;
use Fleetbase\Models\ApiCredential;
use Fleetbase\Models\Company;
use Illuminate\Http\Request;
use Illuminate\Support\Str;

class OrganizationController extends Controller
{
public function getOrganization(Request $request)
{
$token = $request->bearerToken();
$token = $request->bearerToken();
$isSecretKey = Str::startsWith($token, '$');

// Depending on API key format set the connection to find credential on
// Depending on API key format set the connection to find credential on
$connection = Str::startsWith($token, 'flb_test_') ? 'sandbox' : 'mysql';

// Find the API Credential record
Expand All @@ -41,7 +41,7 @@ public function getOrganization(Request $request)

// Get the organization owning the API key
$organization = Company::where('uuid', $apiCredential->company_uuid)->first();

return new Organization($organization);
}
}
3 changes: 1 addition & 2 deletions src/Http/Resources/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace Fleetbase\Http\Resources;

use Fleetbase\Support\Http;
use Fleetbase\Models\Setting;

use Fleetbase\Support\Http;

class Organization extends FleetbaseResource
{
Expand Down
3 changes: 2 additions & 1 deletion src/Support/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -2158,10 +2158,11 @@ public static function getDefaultMailFromAddress(?string $default = 'hello@fleet
*
* This function checks if the given URL starts with 'http://' or 'https://'.
* If it does, it parses the URL and adds 'www.' to the host part if it's not already there.
* If the URL does not start with 'http://' or 'https://', it simply checks if 'www.' is
* If the URL does not start with 'http://' or 'https://', it simply checks if 'www.' is
* already present at the start of the URL. If not, it adds 'www.'.
*
* @param string $url The URL to which 'www.' should be added if it's not already present.
*
* @return string The modified URL with 'www.' added if it was absent.
*
* Example usage:
Expand Down
1 change: 0 additions & 1 deletion src/Traits/Expandable.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Fleetbase\Traits;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;

trait Expandable
{
Expand Down
3 changes: 2 additions & 1 deletion src/Traits/HasMetaAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public function updateMeta($key, $value = null)
$meta[$key] = static::prepareValue($value);

$this->setAttribute('meta', $meta);

return $this->update(['meta' => $meta]);
}

Expand All @@ -120,7 +121,7 @@ public function updateMetaProperties(array $data = [])
$currentMetaObject = array_merge($currentMetaObject, $data);

return DB::table($this->getTable())->where($this->getKeyName(), $this->getKey())->update([
'meta' => json_encode($currentMetaObject)
'meta' => json_encode($currentMetaObject),
]);
}

Expand Down
10 changes: 5 additions & 5 deletions src/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
function ($router) {
$router->get('/', 'Controller@hello');

/*
/*
|--------------------------------------------------------------------------
| Public/Consumable Routes
|--------------------------------------------------------------------------
|
| Routes for users and public applications to consume.
*/
$router->prefix('v1')
->namespace('Api\v1')
->group(function ($router) {
$router->get('organizations','OrganizationController@getOrganization');
});
->namespace('Api\v1')
->group(function ($router) {
$router->get('organizations', 'OrganizationController@getOrganization');
});

/*
|--------------------------------------------------------------------------
Expand Down

0 comments on commit 6a2bc61

Please sign in to comment.