state
value returned from indieauth server',
- 'indieauth'
+ return redirect(route('micropub-client'))->with(
+ 'error',
+ 'Invalid state
value returned from indieauth server'
+ );
+ }
+ $tokenEndpoint = $this->indieAuthService->getTokenEndpoint($request->input('me'));
+ if ($tokenEndpoint === false) {
+ return redirect(route('micropub-client'))->with(
+ 'error',
+ 'Unable to determine token endpoint'
);
}
- $tokenEndpoint = $this->indieAuthService->getTokenEndpoint($request->input('me'), $this->client);
- $redirectURL = config('app.url') . '/indieauth';
- $clientId = config('app.url') . '/notes/new';
$data = [
'endpoint' => $tokenEndpoint,
'code' => $request->input('code'),
'me' => $request->input('me'),
- 'redirect_url' => $redirectURL,
- 'client_id' => $clientId,
+ 'redirect_url' => route('indieauth-callback'),
+ 'client_id' => route('micropub-client'),
'state' => $request->input('state'),
];
- $token = $this->indieAuthService->getAccessToken($data, $this->client);
+ $token = $this->indieAuthService->getAccessToken($data);
if (array_key_exists('access_token', $token)) {
$request->session()->put('me', $token['me']);
$request->session()->put('token', $token['access_token']);
- return redirect('/notes/new');
+ return redirect(route('micropub-client'));
}
- return redirect('/notes/new')->withErrors('Unable to get a token from the endpoint', 'indieauth');
+ return redirect(route('micropub-client'))->with(
+ 'error',
+ 'Unable to get a token from the endpoint'
+ );
+ }
+
+ /**
+ * Log out the user, flush an session data, and overwrite any cookie data.
+ *
+ * @return \Illuminate\Routing\RedirectResponse redirect
+ */
+ public function logout(Request $request)
+ {
+ $request->session()->flush();
+
+ return redirect(route('micropub-client'))->cookie('me', 'loggedout', 1);
}
/**
@@ -125,7 +132,7 @@ class IndieAuthController extends Controller
'client_id' => $request->input('client_id'),
'state' => $request->input('state'),
];
- $auth = $this->indieAuthService->verifyIndieAuthCode($authData, $this->client);
+ $auth = $this->indieAuthService->verifyIndieAuthCode($authData);
if (array_key_exists('me', $auth)) {
$scope = $auth['scope'] ?? '';
$tokenData = [
@@ -140,25 +147,11 @@ class IndieAuthController extends Controller
'access_token' => $token,
]);
- return (new Response($content, 200))
- ->header('Content-Type', 'application/x-www-form-urlencoded');
+ return response($content)
+ ->header('Content-Type', 'application/x-www-form-urlencoded');
}
$content = 'There was an error verifying the authorisation code.';
- return new Response($content, 400);
- }
-
- /**
- * Log out the user, flush an session data, and overwrite any cookie data.
- *
- * @param \Illuminate\Cookie\CookieJar $cookie
- * @return \Illuminate\Routing\RedirectResponse redirect
- */
- public function indieauthLogout(Request $request, CookieJar $cookie)
- {
- $request->session()->flush();
- $cookie->queue('me', 'loggedout', 5);
-
- return redirect('/notes/new');
+ return response($content, 400);
}
}
diff --git a/app/Http/Controllers/MicropubClientController.php b/app/Http/Controllers/MicropubClientController.php
index 92848aa5..c2ecbc2c 100644
--- a/app/Http/Controllers/MicropubClientController.php
+++ b/app/Http/Controllers/MicropubClientController.php
@@ -36,15 +36,12 @@ class MicropubClientController extends Controller
* @param \Illuminate\Http\Request $request
* @return \Illuminate\View\Factory view
*/
- public function newNotePage(Request $request)
+ public function create(Request $request)
{
$url = $request->session()->get('me');
$syndication = $request->session()->get('syndication');
- return view('micropubnewnotepage', [
- 'url' => $url,
- 'syndication' => $syndication,
- ]);
+ return view('micropub.create', compact('url', 'syndication'));
}
/**
@@ -55,7 +52,7 @@ class MicropubClientController extends Controller
* @param \Illuminate\Http\Request $request
* @return mixed
*/
- public function postNewNote(Request $request)
+ public function store(Request $request)
{
$domain = $request->session()->get('me');
$token = $request->session()->get('token');
@@ -65,7 +62,7 @@ class MicropubClientController extends Controller
$this->indieClient
);
if (! $micropubEndpoint) {
- return redirect('notes/new')->withErrors('Unable to determine micropub API endpoint', 'endpoint');
+ return redirect(route('micropub-client'))->with('error', 'Unable to determine micropub API endpoint');
}
$response = $this->postNoteRequest($request, $micropubEndpoint, $token);
@@ -79,7 +76,7 @@ class MicropubClientController extends Controller
return redirect($location);
}
- return redirect('notes/new')->withErrors('Endpoint didn’t create the note.', 'endpoint');
+ return redirect(route('micropub-client'))->with('error', 'Endpoint didn’t create the note.');
}
/**
@@ -90,8 +87,6 @@ class MicropubClientController extends Controller
* and syndicate-to
*
* @param \Illuminate\Http\Request $request
- * @param \IndieAuth\Client $indieClient
- * @param \GuzzleHttp\Client $guzzleClient
* @return \Illuminate\Routing\Redirector redirect
*/
public function refreshSyndicationTargets(Request $request)
@@ -99,9 +94,8 @@ class MicropubClientController extends Controller
$domain = $request->session()->get('me');
$token = $request->session()->get('token');
$micropubEndpoint = $this->indieAuthService->discoverMicropubEndpoint($domain, $this->indieClient);
-
if (! $micropubEndpoint) {
- return redirect('notes/new')->withErrors('Unable to determine micropub API endpoint', 'endpoint');
+ return redirect(route('micropub-client'))->with('error', 'Unable to determine micropub API endpoint');
}
try {
@@ -110,14 +104,17 @@ class MicropubClientController extends Controller
'query' => ['q' => 'syndicate-to'],
]);
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
- return redirect('notes/new')->withErrors('Bad response when refreshing syndication targets', 'endpoint');
+ return redirect(route('micropub-client'))->with(
+ 'error',
+ 'Bad response when refreshing syndication targets'
+ );
}
$body = (string) $response->getBody();
$syndication = $this->parseSyndicationTargets($body);
$request->session()->put('syndication', $syndication);
- return redirect('notes/new');
+ return redirect(route('micropub-client'));
}
/**
@@ -184,8 +181,10 @@ class MicropubClientController extends Controller
'headers' => $headers,
]);
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
- return redirect('notes/new')
- ->withErrors('There was a bad response from the micropub endpoint.', 'endpoint');
+ return redirect(route('micropub-client'))->with(
+ 'error',
+ 'There was a bad response from the micropub endpoint.'
+ );
}
return $response;
@@ -197,7 +196,7 @@ class MicropubClientController extends Controller
* @param \Illuminate\Http\Request $request
* @return mixed
*/
- public function postNewPlace(Request $request)
+ public function newPlace(Request $request)
{
if ($request->session()->has('token') === false) {
return response()->json([
@@ -274,15 +273,10 @@ class MicropubClientController extends Controller
* Make a request to the micropub endpoint requesting any nearby places.
*
* @param \Illuminate\Http\Request $request
- * @param string $latitude
- * @param string $longitude
* @return \Illuminate\Http\Response
*/
- public function nearbyPlaces(
- Request $request,
- $latitude,
- $longitude
- ) {
+ public function nearbyPlaces(Request $request)
+ {
if ($request->session()->has('token') === false) {
return response()->json([
'error' => true,
@@ -302,7 +296,7 @@ class MicropubClientController extends Controller
}
try {
- $query = 'geo:' . $latitude . ',' . $longitude;
+ $query = 'geo:' . $request->input('latitude') . ',' . $request->input('longitude');
if ($request->input('u') !== null) {
$query .= ';u=' . $request->input('u');
}
@@ -319,7 +313,7 @@ class MicropubClientController extends Controller
], 400);
}
- return (new Response($response->getBody(), 200))
+ return response($response->getBody(), 200)
->header('Content-Type', 'application/json');
}
@@ -344,6 +338,8 @@ class MicropubClientController extends Controller
'name' => $syn['name'],
];
}
+ } else {
+ $syndicateTo[] = ['target' => 'http://example.org', 'name' => 'Joe Bloggs on Example'];
}
if (count($syndicateTo) > 0) {
return $syndicateTo;
diff --git a/app/Http/Controllers/MicropubController.php b/app/Http/Controllers/MicropubController.php
index 2c344028..a110bc65 100644
--- a/app/Http/Controllers/MicropubController.php
+++ b/app/Http/Controllers/MicropubController.php
@@ -57,8 +57,46 @@ class MicropubController extends Controller
if (array_search('post', $scopes) !== false) {
$clientId = $tokenData->getClaim('client_id');
if (($request->input('h') == 'entry') || ($request->input('type')[0] == 'h-entry')) {
+ $data = [];
+ $data['client-id'] = $clientId;
+ if ($request->header('Content-Type') == 'application/json') {
+ $data['content'] = $request->input('properties.content')[0];
+ $data['in-reply-to'] = $request->input('properties.in-reply-to')[0];
+ $data['location'] = $request->input('properties.location');
+ //flatten location if array
+ if (is_array($data['location'])) {
+ $data['location'] = $data['location'][0];
+ }
+ } else {
+ $data['content'] = $request->input('content');
+ $data['in-reply-to'] = $request->input('in-reply-to');
+ $data['location'] = $request->input('location');
+ }
+ $data['syndicate'] = [];
+ $targets = array_pluck(config('syndication.targets'), 'uid', 'service.name');
+ if (is_string($request->input('mp-syndicate-to'))) {
+ $service = array_search($request->input('mp-syndicate-to'));
+ if ($service == 'Twitter') {
+ $data['syndicate'][] = 'twitter';
+ }
+ if ($service == 'Facebook') {
+ $data['syndicate'][] = 'facebook';
+ }
+ }
+ if (is_array($request->input('mp-syndicate-to'))) {
+ foreach ($targets as $service => $target) {
+ if (in_array($target, $request->input('mp-syndicate-to'))) {
+ if ($service == 'Twitter') {
+ $data['syndicate'][] = 'twitter';
+ }
+ if ($service == 'Facebook') {
+ $data['syndicate'][] = 'facebook';
+ }
+ }
+ }
+ }
try {
- $note = $this->noteService->createNote($request, $clientId);
+ $note = $this->noteService->createNote($data);
} catch (Exception $exception) {
return response()->json(['error' => true], 400);
}
@@ -69,8 +107,26 @@ class MicropubController extends Controller
], 201)->header('Location', $note->longurl);
}
if ($request->input('h') == 'card' || $request->input('type')[0] == 'h-card') {
+ $data = [];
+ if ($request->header('Content-Type') == 'application/json') {
+ $data['name'] = $request->input('properties.name');
+ $data['description'] = $request->input('properties.description') ?? null;
+ if ($request->has('properties.geo')) {
+ $data['geo'] = $request->input('properties.geo');
+ }
+ } else {
+ $data['name'] = $request->input('name');
+ $data['description'] = $request->input('description');
+ if ($request->has('geo')) {
+ $data['geo'] = $request->input('geo');
+ }
+ if ($request->has('latitude')) {
+ $data['latitude'] = $request->input('latitude');
+ $data['longitude'] = $request->input('longitude');
+ }
+ }
try {
- $place = $this->placeService->createPlace($request);
+ $place = $this->placeService->createPlace($data);
} catch (Exception $exception) {
return response()->json(['error' => true], 400);
}
@@ -106,7 +162,7 @@ class MicropubController extends Controller
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
- public function getEndpoint(Request $request)
+ public function get(Request $request)
{
$httpAuth = $request->header('Authorization');
if (preg_match('/Bearer (.+)/', $httpAuth, $match)) {
@@ -162,16 +218,11 @@ class MicropubController extends Controller
],
]);
}
- $content = 'No OAuth token sent with request.';
- $content = <<<'EOD'
-{
- "response": "error",
- "error": "no_token",
- "error_description": "No token provided with request"
-}
-EOD;
- return (new Response($content, 400))
- ->header('Content-Type', 'application/json');
+ return response()->json([
+ 'response' => 'error',
+ 'error' => 'no_token',
+ 'error_description' => 'No token provided with request',
+ ], 400);
}
}
diff --git a/app/Http/Controllers/NotesController.php b/app/Http/Controllers/NotesController.php
index f964e52e..45915796 100644
--- a/app/Http/Controllers/NotesController.php
+++ b/app/Http/Controllers/NotesController.php
@@ -24,7 +24,7 @@ class NotesController extends Controller
* @param Illuminate\Http\Request request;
* @return \Illuminte\View\Factory view
*/
- public function showNotes(Request $request)
+ public function index(Request $request)
{
$notes = Note::orderBy('id', 'desc')->with('webmentions', 'place', 'media')->paginate(10);
foreach ($notes as $note) {
@@ -51,7 +51,12 @@ class NotesController extends Controller
$note->longitude = $lnglat[0];
$note->address = $note->place->name;
$note->placeLink = '/places/' . $note->place->slug;
- $note->geoJson = $this->getGeoJson($note->longitude, $note->latitude, $note->place->name, $note->place->icon);
+ $note->geoJson = $this->getGeoJson(
+ $note->longitude,
+ $note->latitude,
+ $note->place->name,
+ $note->place->icon
+ );
}
$photoURLs = [];
$photos = $note->getMedia();
@@ -63,7 +68,7 @@ class NotesController extends Controller
$homepage = ($request->path() == '/');
- return view('notes', compact('notes', 'homepage'));
+ return view('notes.index', compact('notes', 'homepage'));
}
/**
@@ -72,7 +77,7 @@ class NotesController extends Controller
* @param string The id of the note
* @return \Illuminate\View\Factory view
*/
- public function singleNote($urlId)
+ public function show($urlId)
{
$numbers = new Numbers();
$authorship = new Authorship();
@@ -151,7 +156,12 @@ class NotesController extends Controller
$note->longitude = $lnglat[0];
$note->address = $note->place->name;
$note->placeLink = '/places/' . $note->place->slug;
- $note->geoJson = $this->getGeoJson($note->longitude, $note->latitude, $note->place->name, $note->place->icon);
+ $note->geoJson = $this->getGeoJson(
+ $note->longitude,
+ $note->latitude,
+ $note->place->name,
+ $note->place->icon
+ );
}
$photoURLs = [];
@@ -161,7 +171,7 @@ class NotesController extends Controller
}
$note->photoURLs = $photoURLs;
- return view('note', compact('note', 'replies', 'reposts', 'likes'));
+ return view('notes.show', compact('note', 'replies', 'reposts', 'likes'));
}
/**
@@ -170,7 +180,7 @@ class NotesController extends Controller
* @param string The decimal id of he note
* @return \Illuminate\Routing\RedirectResponse redirect
*/
- public function singleNoteRedirect($decId)
+ public function redirect($decId)
{
$numbers = new Numbers();
$realId = $numbers->numto60($decId);
@@ -186,7 +196,7 @@ class NotesController extends Controller
* @param string The tag
* @return \Illuminate\View\Factory view
*/
- public function taggedNotes($tag)
+ public function tagged($tag)
{
$notes = Note::whereHas('tags', function ($query) use ($tag) {
$query->where('tag', $tag);
@@ -196,7 +206,7 @@ class NotesController extends Controller
$note->human_time = $note->updated_at->diffForHumans();
}
- return view('taggednotes', compact('notes', 'tag'));
+ return view('notes.tagged', compact('notes', 'tag'));
}
/**
diff --git a/app/Http/Controllers/PlacesController.php b/app/Http/Controllers/PlacesController.php
index d28a6852..ba8d5b42 100644
--- a/app/Http/Controllers/PlacesController.php
+++ b/app/Http/Controllers/PlacesController.php
@@ -3,7 +3,6 @@
namespace App\Http\Controllers;
use App\Place;
-use Illuminate\Http\Request;
class PlacesController extends Controller
{
@@ -19,27 +18,6 @@ class PlacesController extends Controller
return view('allplaces', ['places' => $places]);
}
- /**
- * Show the form for creating a new resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function create()
- {
- //
- }
-
- /**
- * Store a newly created resource in storage.
- *
- * @param \Illuminate\Http\Request $request
- * @return \Illuminate\Http\Response
- */
- public function store(Request $request)
- {
- //
- }
-
/**
* Display the specified resource.
*
@@ -48,42 +26,8 @@ class PlacesController extends Controller
*/
public function show($slug)
{
- $place = Place::where('slug', '=', $slug)->first();
+ $place = Place::where('slug', '=', $slug)->firstOrFail();
return view('singleplace', ['place' => $place]);
}
-
- /**
- * Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
- */
- public function edit($id)
- {
- //
- }
-
- /**
- * Update the specified resource in storage.
- *
- * @param \Illuminate\Http\Request $request
- * @param int $id
- * @return \Illuminate\Http\Response
- */
- public function update(Request $request, $id)
- {
- //
- }
-
- /**
- * Remove the specified resource from storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
- */
- public function destroy($id)
- {
- //
- }
}
diff --git a/app/Http/Controllers/TokensController.php b/app/Http/Controllers/TokensController.php
deleted file mode 100644
index 5f896e80..00000000
--- a/app/Http/Controllers/TokensController.php
+++ /dev/null
@@ -1,61 +0,0 @@
-tokenService = $tokenService ?? new TokenService();
- }
-
- /**
- * Show all the saved tokens.
- *
- * @return \Illuminate\View\Factory view
- */
- public function showTokens()
- {
- $tokens = $$his->tokenService->getAll();
-
- return view('admin.listtokens', ['tokens' => $tokens]);
- }
-
- /**
- * Show the form to delete a certain token.
- *
- * @param string The token id
- * @return \Illuminate\View\Factory view
- */
- public function deleteToken($tokenId)
- {
- return view('admin.deletetoken', ['id' => $tokenId]);
- }
-
- /**
- * Process the request to delete a token.
- *
- * @param string The token id
- * @return \Illuminate\View\Factory view
- */
- public function postDeleteToken($tokenId)
- {
- $this->tokenService->deleteToken($tokenId);
-
- return view('admin.deletetokensuccess', ['id' => $tokenId]);
- }
-}
diff --git a/app/Http/Middleware/DevTokenMiddleware.php b/app/Http/Middleware/DevTokenMiddleware.php
index b1d5e02e..dabc2ca2 100644
--- a/app/Http/Middleware/DevTokenMiddleware.php
+++ b/app/Http/Middleware/DevTokenMiddleware.php
@@ -17,9 +17,17 @@ class DevTokenMiddleware
public function handle($request, Closure $next)
{
if (config('app.env') !== 'production') {
- session(['me' => env('APP_URL')]);
+ session(['me' => config('app.url')]);
if (Storage::exists('dev-token')) {
session(['token' => Storage::get('dev-token')]);
+ } else {
+ $data = [
+ 'me' => config('app.url'),
+ 'client_id' => route('micropub-client'),
+ 'scope' => 'post',
+ ];
+ $tokenService = new \App\Services\TokenService();
+ session(['token' => $tokenService->getNewToken($data)]);
}
}
diff --git a/app/Jobs/SendWebMentions.php b/app/Jobs/SendWebMentions.php
index 41bd499b..dd4e2835 100644
--- a/app/Jobs/SendWebMentions.php
+++ b/app/Jobs/SendWebMentions.php
@@ -61,7 +61,7 @@ class SendWebMentions implements ShouldQueue
public function discoverWebmentionEndpoint($url, $guzzle)
{
//let’s not send webmentions to myself
- if (parse_url($url, PHP_URL_HOST) == env('LONG_URL', 'localhost')) {
+ if (parse_url($url, PHP_URL_HOST) == config('app.longurl')) {
return false;
}
if (starts_with($url, '/notes/tagged/')) {
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 3c5c8377..d3aa0488 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -5,6 +5,7 @@ namespace App\Providers;
use App\Tag;
use App\Note;
use Validator;
+use Laravel\Dusk\DuskServiceProvider;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@@ -54,6 +55,8 @@ class AppServiceProvider extends ServiceProvider
*/
public function register()
{
- //
+ if ($this->app->environment('local', 'testing')) {
+ $this->app->register(DuskServiceProvider::class);
+ }
}
}
diff --git a/app/Services/IndieAuthService.php b/app/Services/IndieAuthService.php
index cc7c775c..29b3b65c 100644
--- a/app/Services/IndieAuthService.php
+++ b/app/Services/IndieAuthService.php
@@ -1,20 +1,35 @@
client = new Client();
+ }
+
/**
* Given a domain, determing the assocaited authorization endpoint,
* if one exists.
*
* @param string The domain
- * @param \IndieAuth\Client $client
* @return string|null
*/
- public function getAuthorizationEndpoint($domain, $client)
+ public function getAuthorizationEndpoint(string $domain): ?string
{
- return $client->discoverAuthorizationEndpoint($client->normalizeMeURL($domain));
+ $endpoint = $this->client->discoverAuthorizationEndpoint($this->client->normalizeMeURL($domain));
+ if ($endpoint === false) {
+ return null;
+ }
+
+ return $endpoint;
}
/**
@@ -22,20 +37,18 @@ class IndieAuthService
*
* @param string $authEndpoint
* @param string $domain
- * @param \IndieAuth\Client $client
* @return string
*/
- public function buildAuthorizationURL($authEndpoint, $domain, $client)
+ public function buildAuthorizationURL(string $authEndpoint, string $domain): string
{
- $domain = $client->normalizeMeURL($domain);
$state = bin2hex(openssl_random_pseudo_bytes(16));
session(['state' => $state]);
- $redirectURL = config('app.url') . '/indieauth';
- $clientId = config('app.url') . '/notes/new';
+ $redirectURL = route('indieauth-callback');
+ $clientId = route('micropub-client');
$scope = 'post';
- $authorizationURL = $client->buildAuthorizationURL(
+ $authorizationURL = $this->client->buildAuthorizationURL(
$authEndpoint,
- $domain,
+ $this->client->normalizeMeURL($domain),
$redirectURL,
$clientId,
$state,
@@ -49,24 +62,22 @@ class IndieAuthService
* Discover the token endpoint for a given domain.
*
* @param string The domain
- * @param \IndieAuth\Client $client
* @return string|null
*/
- public function getTokenEndpoint($domain, $client)
+ public function getTokenEndpoint(string $domain): ?string
{
- return $client->discoverTokenEndpoint($domain);
+ return $this->client->discoverTokenEndpoint($this->client->normalizeMeURL($domain));
}
/**
* Retrieve a token from the token endpoint.
*
* @param array The relavent data
- * @param \IndieAuth\Client $client
* @return array
*/
- public function getAccessToken(array $data, $client)
+ public function getAccessToken(array $data): array
{
- return $client->getAccessToken(
+ return $this->client->getAccessToken(
$data['endpoint'],
$data['code'],
$data['me'],
@@ -81,14 +92,13 @@ class IndieAuthService
* valid.
*
* @param array The data.
- * @param \IndieAuth\Client $client
* @return array|null
*/
- public function verifyIndieAuthCode(array $data, $client)
+ public function verifyIndieAuthCode(array $data): ?array
{
- $authEndpoint = $client->discoverAuthorizationEndpoint($data['me']);
+ $authEndpoint = $this->client->discoverAuthorizationEndpoint($data['me']);
if ($authEndpoint) {
- return $client->verifyIndieAuthCode(
+ return $this->client->verifyIndieAuthCode(
$authEndpoint,
$data['code'],
$data['me'],
@@ -103,11 +113,10 @@ class IndieAuthService
* Determine the micropub endpoint.
*
* @param string $domain
- * @param \IndieAuth\Client $client
- * @return string The endpoint
+ * @return string|null The endpoint
*/
- public function discoverMicropubEndpoint($domain, $client)
+ public function discoverMicropubEndpoint(string $domain): ?string
{
- return $client->discoverMicropubEndpoint($client->normalizeMeURL($domain));
+ return $this->client->discoverMicropubEndpoint($this->client->normalizeMeURL($domain));
}
}
diff --git a/app/Services/NoteService.php b/app/Services/NoteService.php
index 80e5cdb1..f5ce84b1 100644
--- a/app/Services/NoteService.php
+++ b/app/Services/NoteService.php
@@ -1,10 +1,11 @@
header('Content-Type') == 'application/json') {
- $content = $request->input('properties.content')[0];
- $inReplyTo = $request->input('properties.in-reply-to')[0];
- $location = $request->input('properties.location');
- if (is_array($location)) {
- $location = $location[0];
- }
- } else {
- $content = $request->input('content');
- $inReplyTo = $request->input('in-reply-to');
- $location = $request->input('location');
- }
-
$note = Note::create(
[
- 'note' => $content,
- 'in_reply_to' => $inReplyTo,
- 'client_id' => $clientId,
+ 'note' => $data['content'],
+ 'in_reply_to' => $data['in-reply-to'],
+ 'client_id' => $data['client-id'],
]
);
- if ($location !== null && $location !== 'no-location') {
- if (substr($location, 0, strlen(config('app.url'))) == config('app.url')) {
+ if (array_key_exists('location', $data) && $data['location'] !== null && $data['location'] !== 'no-location') {
+ if (substr($data['location'], 0, strlen(config('app.url'))) == config('app.url')) {
//uri of form http://host/places/slug, we want slug so chop off start
//that’s the app’s url plus `/places/`
$slug = mb_substr($location, mb_strlen(config('app.url')) + 8);
$place = Place::where('slug', '=', $slug)->first();
$note->place()->associate($place);
- $note->save();
}
- if (substr($location, 0, 4) == 'geo:') {
+ if (substr($data['location'], 0, 4) == 'geo:') {
preg_match_all(
'/([0-9\.\-]+)/',
- $location,
+ $data['location'],
$matches
);
$note->location = $matches[0][0] . ', ' . $matches[0][1];
- $note->save();
}
}
+ /* drop image support for now
//add images to media library
if ($request->hasFile('photo')) {
$files = $request->file('photo');
@@ -68,40 +54,19 @@ class NoteService
$note->addMedia($file)->toCollectionOnDisk('images', 's3');
}
}
+ */
+
+ $note->save();
dispatch(new SendWebMentions($note));
//syndication targets
- //from admin CP
- if ($request->input('twitter')) {
+ if (in_array('twitter', $data['syndicate'])) {
dispatch(new SyndicateToTwitter($note));
}
- if ($request->input('facebook')) {
+ if (in_array('facebook', $data['syndicate'])) {
dispatch(new SyndicateToFacebook($note));
}
- //from a micropub request
- $targets = array_pluck(config('syndication.targets'), 'uid', 'service.name');
- if (is_string($request->input('mp-syndicate-to'))) {
- $service = array_search($request->input('mp-syndicate-to'));
- if ($service == 'Twitter') {
- dispatch(new SyndicateToTwitter($note));
- }
- if ($service == 'Facebook') {
- dispatch(new SyndicateToFacebook($note));
- }
- }
- if (is_array($request->input('mp-syndicate-to'))) {
- foreach ($targets as $service => $target) {
- if (in_array($target, $request->input('mp-syndicate-to'))) {
- if ($service == 'Twitter') {
- dispatch(new SyndicateToTwitter($note));
- }
- if ($service == 'Facebook') {
- dispatch(new SyndicateToFacebook($note));
- }
- }
- }
- }
return $note;
}
diff --git a/app/Services/PlaceService.php b/app/Services/PlaceService.php
index 602e097b..1a02dff5 100644
--- a/app/Services/PlaceService.php
+++ b/app/Services/PlaceService.php
@@ -1,9 +1,10 @@
header('Content-Type') == 'application/json') {
- $name = $request->input('properties.name');
- $description = $request->input('properties.description') ?? null;
- $geo = $request->input('properties.geo');
- } else {
- $name = $request->input('name');
- $description = $request->input('description');
- $geo = $request->input('geo');
- }
- if ($geo) {
+ //obviously a place needs a lat/lng, but this could be sent in a geo-url
+ //if no geo array key, we assume the array already has lat/lng values
+ if (array_key_exists('geo', $data)) {
preg_match_all(
'/([0-9\.\-]+)/',
- $geo,
+ $data['geo'],
$matches
);
- $latitude = $matches[0][0];
- $longitude = $matches[0][1];
- }
- if ($request->input('latitude') !== null) {
- $latitude = $request->input('latitude');
- $longitude = $request->input('longitude');
+ $data['latitude'] = $matches[0][0];
+ $data['longitude'] = $matches[0][1];
}
$place = new Place();
- $place->name = $name;
- $place->description = $description;
- $place->location = new Point((float) $latitude, (float) $longitude);
+ $place->name = $data['name'];
+ $place->description = $data['description'];
+ $place->location = new Point((float) $data['latitude'], (float) $data['longitude']);
$place->save();
return $place;
diff --git a/app/Services/TokenService.php b/app/Services/TokenService.php
index 4652d30b..fd4cd1cb 100644
--- a/app/Services/TokenService.php
+++ b/app/Services/TokenService.php
@@ -1,8 +1,11 @@
set('scope', $data['scope'])
->set('date_issued', time())
->set('nonce', bin2hex(random_bytes(8)))
- ->sign($signer, env('APP_KEY'))
+ ->sign($signer, config('app.key'))
->getToken();
- return $token;
+ return (string) $token;
}
/**
@@ -36,17 +39,15 @@ class TokenService
* @param string The token
* @return mixed
*/
- public function validateToken($token)
+ public function validateToken(string $token): ?Token
{
$signer = new Sha256();
try {
$token = (new Parser())->parse((string) $token);
- } catch (InvalidArgumentException $e) {
- return;
- } catch (RuntimeException $e) {
- return;
+ } catch (InvalidArgumentException | RuntimeException $e) {
+ return null;
}
- if ($token->verify($signer, env('APP_KEY'))) {
+ if ($token->verify($signer, config('app.key'))) {
//signuture valid
return $token;
}
diff --git a/changelog.md b/changelog.md
index 547da3d7..0a7d3b04 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,13 @@
# Changelog
+## Version 0.3 (2017-03-02)
+ - convert env() calls to config() calls for cacheing
+ - refactor routes and give important one names
+ - Add Dusk tests
+ - Add a deploy script
+ - Add a .editorconfig file
+ - Bump to PHP 7.1 to start using nullable return types and strict types
+
## Version 0.2.5 (2017-02-15)
- Small fix for homepage bio, removed confusing un-needed view that caused fix to be necessary
diff --git a/composer.json b/composer.json
index 8b6e90f1..8eab83ba 100644
--- a/composer.json
+++ b/composer.json
@@ -5,8 +5,7 @@
"license": "CC0-1.0",
"type": "project",
"require": {
- "ext-intl": "*",
- "php": ">=7.0.0",
+ "php": ">=7.1.0",
"laravel/framework": "5.4.*",
"jonnybarnes/indieweb": "dev-master",
"jonnybarnes/webmentions-parser": "0.4.*",
@@ -25,18 +24,16 @@
"sensiolabs/security-checker": "^4.0",
"laravel/scout": "^3.0",
"pmatseykanets/laravel-scout-postgres": "^0.5.0",
- "jonnybarnes/emoji-a11y": "^0.1.1",
+ "jonnybarnes/emoji-a11y": "^0.2",
"laravel/tinker": "^1.0"
},
"require-dev": {
- "fzaninotto/faker": "~1.4",
- "mockery/mockery": "0.9.*",
- "phpunit/phpunit": "~5.7",
- "symfony/css-selector": "3.1.*",
- "symfony/dom-crawler": "3.1.*",
"barryvdh/laravel-debugbar": "~2.0",
+ "fzaninotto/faker": "~1.4",
"jakub-onderka/php-parallel-lint": "^0.9.2",
- "laravel/browser-kit-testing": "^1.0"
+ "laravel/dusk": "^1.0",
+ "mockery/mockery": "0.9.*",
+ "phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
@@ -47,10 +44,9 @@
}
},
"autoload-dev": {
- "classmap": [
- "tests/TestCase.php",
- "tests/BrowserKitTest.php"
- ]
+ "psr-4": {
+ "Tests\\": "tests"
+ }
},
"scripts": {
"post-root-package-install": [
diff --git a/composer.lock b/composer.lock
index eae3833f..0dbf2149 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "16af842252275cac279c7f118ad6e6d4",
+ "content-hash": "f3b7bcd2d79e776a84c1387f2086a5cc",
"packages": [
{
"name": "anahkiasen/underscore-php",
@@ -58,22 +58,22 @@
},
{
"name": "aws/aws-sdk-php",
- "version": "3.22.4",
+ "version": "3.18.23",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "916f708c1a643f86f74eacd3c5be787b40d814f8"
+ "reference": "a2791b6f14b7aa6eeb4fb9f3f779cc291ab455db"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/916f708c1a643f86f74eacd3c5be787b40d814f8",
- "reference": "916f708c1a643f86f74eacd3c5be787b40d814f8",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a2791b6f14b7aa6eeb4fb9f3f779cc291ab455db",
+ "reference": "a2791b6f14b7aa6eeb4fb9f3f779cc291ab455db",
"shasum": ""
},
"require": {
- "guzzlehttp/guzzle": "^5.3.1|^6.2.1",
+ "guzzlehttp/guzzle": "~5.3|~6.0.1|~6.1",
"guzzlehttp/promises": "~1.0",
- "guzzlehttp/psr7": "~1.3.1",
+ "guzzlehttp/psr7": "~1.0",
"mtdowling/jmespath.php": "~2.2",
"php": ">=5.5"
},
@@ -134,7 +134,7 @@
"s3",
"sdk"
],
- "time": "2017-02-14T21:23:54+00:00"
+ "time": "2016-06-30T19:49:43+00:00"
},
{
"name": "barnabywalters/mf-cleaner",
@@ -265,16 +265,16 @@
},
{
"name": "doctrine/annotations",
- "version": "v1.3.1",
+ "version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
- "reference": "bd4461328621bde0ae6b1b2675fbc6aca4ceb558"
+ "reference": "54cacc9b81758b14e3ce750f205a393d52339e97"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/annotations/zipball/bd4461328621bde0ae6b1b2675fbc6aca4ceb558",
- "reference": "bd4461328621bde0ae6b1b2675fbc6aca4ceb558",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97",
+ "reference": "54cacc9b81758b14e3ce750f205a393d52339e97",
"shasum": ""
},
"require": {
@@ -283,7 +283,7 @@
},
"require-dev": {
"doctrine/cache": "1.*",
- "phpunit/phpunit": "^5.6.1"
+ "phpunit/phpunit": "^5.7"
},
"type": "library",
"extra": {
@@ -329,7 +329,7 @@
"docblock",
"parser"
],
- "time": "2016-12-30T15:59:45+00:00"
+ "time": "2017-02-24T16:22:25+00:00"
},
{
"name": "doctrine/cache",
@@ -917,21 +917,21 @@
},
{
"name": "guzzlehttp/guzzle",
- "version": "6.2.2",
+ "version": "6.2.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60"
+ "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
- "reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006",
+ "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006",
"shasum": ""
},
"require": {
"guzzlehttp/promises": "^1.0",
- "guzzlehttp/psr7": "^1.3.1",
+ "guzzlehttp/psr7": "^1.4",
"php": ">=5.5"
},
"require-dev": {
@@ -975,7 +975,7 @@
"rest",
"web service"
],
- "time": "2016-10-08T15:01:37+00:00"
+ "time": "2017-02-28T22:50:30+00:00"
},
{
"name": "guzzlehttp/promises",
@@ -1030,16 +1030,16 @@
},
{
"name": "guzzlehttp/psr7",
- "version": "1.3.1",
+ "version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b"
+ "reference": "0d6c7ca039329247e4f0f8f8f6506810e8248855"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
- "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/0d6c7ca039329247e4f0f8f8f6506810e8248855",
+ "reference": "0d6c7ca039329247e4f0f8f8f6506810e8248855",
"shasum": ""
},
"require": {
@@ -1075,16 +1075,23 @@
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Tobias Schultze",
+ "homepage": "https://github.com/Tobion"
}
],
- "description": "PSR-7 message implementation",
+ "description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
"http",
"message",
+ "request",
+ "response",
"stream",
- "uri"
+ "uri",
+ "url"
],
- "time": "2016-06-24T23:00:38+00:00"
+ "time": "2017-02-27T10:51:17+00:00"
},
{
"name": "indieauth/client",
@@ -1375,23 +1382,23 @@
},
{
"name": "jonnybarnes/emoji-a11y",
- "version": "v0.1.1",
+ "version": "v0.2",
"source": {
"type": "git",
"url": "https://github.com/jonnybarnes/emoji-a11y.git",
- "reference": "bb9d7427bdaab139d746de1c4273fea6ebc52206"
+ "reference": "ee9062d345ce05c02036b5d5a990b3b0e8bfc34f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/jonnybarnes/emoji-a11y/zipball/bb9d7427bdaab139d746de1c4273fea6ebc52206",
- "reference": "bb9d7427bdaab139d746de1c4273fea6ebc52206",
+ "url": "https://api.github.com/repos/jonnybarnes/emoji-a11y/zipball/ee9062d345ce05c02036b5d5a990b3b0e8bfc34f",
+ "reference": "ee9062d345ce05c02036b5d5a990b3b0e8bfc34f",
"shasum": ""
},
"require": {
"php": ">=7.0"
},
"require-dev": {
- "phpunit/phpunit": "~5.7"
+ "phpunit/phpunit": "~6.0"
},
"type": "library",
"autoload": {
@@ -1415,7 +1422,7 @@
"accessibility",
"emoji"
],
- "time": "2017-02-02T00:20:12+00:00"
+ "time": "2017-02-15T17:23:34+00:00"
},
{
"name": "jonnybarnes/indieweb",
@@ -1510,16 +1517,16 @@
},
{
"name": "laravel/framework",
- "version": "v5.4.12",
+ "version": "v5.4.15",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "707f32d32dce58232f7a860e0a1d62caf6f9dbfc"
+ "reference": "ecc6468b8af30b77566a8519ce8898740ef691d7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/707f32d32dce58232f7a860e0a1d62caf6f9dbfc",
- "reference": "707f32d32dce58232f7a860e0a1d62caf6f9dbfc",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/ecc6468b8af30b77566a8519ce8898740ef691d7",
+ "reference": "ecc6468b8af30b77566a8519ce8898740ef691d7",
"shasum": ""
},
"require": {
@@ -1635,20 +1642,20 @@
"framework",
"laravel"
],
- "time": "2017-02-15T14:31:32+00:00"
+ "time": "2017-03-02T14:41:40+00:00"
},
{
"name": "laravel/scout",
- "version": "v3.0.1",
+ "version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/scout.git",
- "reference": "c742ada38f7056dba336dae441d9eaf11000cb76"
+ "reference": "1ddb0fa6f165bf6a69864960102062e7cf3f989d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/scout/zipball/c742ada38f7056dba336dae441d9eaf11000cb76",
- "reference": "c742ada38f7056dba336dae441d9eaf11000cb76",
+ "url": "https://api.github.com/repos/laravel/scout/zipball/1ddb0fa6f165bf6a69864960102062e7cf3f989d",
+ "reference": "1ddb0fa6f165bf6a69864960102062e7cf3f989d",
"shasum": ""
},
"require": {
@@ -1695,7 +1702,7 @@
"laravel",
"search"
],
- "time": "2017-02-01T16:57:41+00:00"
+ "time": "2017-03-01T14:37:40+00:00"
},
{
"name": "laravel/tinker",
@@ -2451,16 +2458,16 @@
},
{
"name": "paragonie/random_compat",
- "version": "v2.0.4",
+ "version": "v2.0.7",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
- "reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e"
+ "reference": "b5ea1ef3d8ff10c307ba8c5945c2f134e503278f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/paragonie/random_compat/zipball/a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e",
- "reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e",
+ "url": "https://api.github.com/repos/paragonie/random_compat/zipball/b5ea1ef3d8ff10c307ba8c5945c2f134e503278f",
+ "reference": "b5ea1ef3d8ff10c307ba8c5945c2f134e503278f",
"shasum": ""
},
"require": {
@@ -2495,7 +2502,7 @@
"pseudorandom",
"random"
],
- "time": "2016-11-07T23:38:38+00:00"
+ "time": "2017-02-27T17:11:23+00:00"
},
{
"name": "patchwork/utf8",
@@ -2810,16 +2817,16 @@
},
{
"name": "psy/psysh",
- "version": "v0.8.1",
+ "version": "v0.8.2",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
- "reference": "701e8a1cc426ee170f1296f5d9f6b8a26ad25c4a"
+ "reference": "97113db4107a4126bef933b60fea6dbc9f615d41"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/bobthecow/psysh/zipball/701e8a1cc426ee170f1296f5d9f6b8a26ad25c4a",
- "reference": "701e8a1cc426ee170f1296f5d9f6b8a26ad25c4a",
+ "url": "https://api.github.com/repos/bobthecow/psysh/zipball/97113db4107a4126bef933b60fea6dbc9f615d41",
+ "reference": "97113db4107a4126bef933b60fea6dbc9f615d41",
"shasum": ""
},
"require": {
@@ -2879,7 +2886,7 @@
"interactive",
"shell"
],
- "time": "2017-01-15T17:54:13+00:00"
+ "time": "2017-03-01T00:13:29+00:00"
},
{
"name": "ramsey/uuid",
@@ -2965,16 +2972,16 @@
},
{
"name": "sensiolabs/security-checker",
- "version": "v4.0.0",
+ "version": "v4.0.1",
"source": {
"type": "git",
"url": "https://github.com/sensiolabs/security-checker.git",
- "reference": "116027b57b568ed61b7b1c80eeb4f6ee9e8c599c"
+ "reference": "f2ce0035fc512287978510ca1740cd111d60f89f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/116027b57b568ed61b7b1c80eeb4f6ee9e8c599c",
- "reference": "116027b57b568ed61b7b1c80eeb4f6ee9e8c599c",
+ "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/f2ce0035fc512287978510ca1740cd111d60f89f",
+ "reference": "f2ce0035fc512287978510ca1740cd111d60f89f",
"shasum": ""
},
"require": {
@@ -3005,7 +3012,7 @@
}
],
"description": "A security checker for your composer.lock",
- "time": "2016-09-23T18:09:57+00:00"
+ "time": "2017-02-18T17:53:25+00:00"
},
{
"name": "spatie/laravel-glide",
@@ -3280,16 +3287,16 @@
},
{
"name": "symfony/console",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936"
+ "reference": "0e5e6899f82230fcb1153bcaf0e106ffaa44b870"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/7a8405a9fc175f87fed8a3c40856b0d866d61936",
- "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936",
+ "url": "https://api.github.com/repos/symfony/console/zipball/0e5e6899f82230fcb1153bcaf0e106ffaa44b870",
+ "reference": "0e5e6899f82230fcb1153bcaf0e106ffaa44b870",
"shasum": ""
},
"require": {
@@ -3339,20 +3346,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2017-02-06T12:04:21+00:00"
+ "time": "2017-02-16T14:07:22+00:00"
},
{
"name": "symfony/css-selector",
- "version": "v3.1.10",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d"
+ "reference": "f0e628f04fc055c934b3211cfabdb1c59eefbfaa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d",
- "reference": "722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/f0e628f04fc055c934b3211cfabdb1c59eefbfaa",
+ "reference": "f0e628f04fc055c934b3211cfabdb1c59eefbfaa",
"shasum": ""
},
"require": {
@@ -3361,7 +3368,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -3392,20 +3399,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
- "time": "2017-01-02T20:31:54+00:00"
+ "time": "2017-01-02T20:32:22+00:00"
},
{
"name": "symfony/debug",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477"
+ "reference": "9b98854cb45bc59d100b7d4cc4cf9e05f21026b9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/b4d9818f127c60ce21ed62c395da7df868dc8477",
- "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/9b98854cb45bc59d100b7d4cc4cf9e05f21026b9",
+ "reference": "9b98854cb45bc59d100b7d4cc4cf9e05f21026b9",
"shasum": ""
},
"require": {
@@ -3449,11 +3456,11 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
- "time": "2017-01-28T02:37:08+00:00"
+ "time": "2017-02-16T16:34:18+00:00"
},
{
"name": "symfony/event-dispatcher",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
@@ -3513,7 +3520,7 @@
},
{
"name": "symfony/finder",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
@@ -3562,16 +3569,16 @@
},
{
"name": "symfony/http-foundation",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "e192b04de44aa1ed0e39d6793f7e06f5e0b672a0"
+ "reference": "a90da6dd679605d88c9803a57a6fc1fb7a19a6e0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e192b04de44aa1ed0e39d6793f7e06f5e0b672a0",
- "reference": "e192b04de44aa1ed0e39d6793f7e06f5e0b672a0",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a90da6dd679605d88c9803a57a6fc1fb7a19a6e0",
+ "reference": "a90da6dd679605d88c9803a57a6fc1fb7a19a6e0",
"shasum": ""
},
"require": {
@@ -3611,20 +3618,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
- "time": "2017-02-02T13:47:35+00:00"
+ "time": "2017-02-16T22:46:52+00:00"
},
{
"name": "symfony/http-kernel",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
- "reference": "96443239baf674b143604fb87cb27cb01672ab77"
+ "reference": "4cd0d4bc31819095c6ef13573069f621eb321081"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-kernel/zipball/96443239baf674b143604fb87cb27cb01672ab77",
- "reference": "96443239baf674b143604fb87cb27cb01672ab77",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/4cd0d4bc31819095c6ef13573069f621eb321081",
+ "reference": "4cd0d4bc31819095c6ef13573069f621eb321081",
"shasum": ""
},
"require": {
@@ -3693,7 +3700,7 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
- "time": "2017-02-06T13:15:19+00:00"
+ "time": "2017-02-16T23:59:56+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -3756,16 +3763,16 @@
},
{
"name": "symfony/process",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "32646a7cf53f3956c76dcb5c82555224ae321858"
+ "reference": "0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/32646a7cf53f3956c76dcb5c82555224ae321858",
- "reference": "32646a7cf53f3956c76dcb5c82555224ae321858",
+ "url": "https://api.github.com/repos/symfony/process/zipball/0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856",
+ "reference": "0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856",
"shasum": ""
},
"require": {
@@ -3801,11 +3808,11 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2017-02-03T12:11:38+00:00"
+ "time": "2017-02-16T14:07:22+00:00"
},
{
"name": "symfony/routing",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
@@ -3880,16 +3887,16 @@
},
{
"name": "symfony/translation",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "ca032cc56976d88b85e7386b17020bc6dc95dbc5"
+ "reference": "d6825c6bb2f1da13f564678f9f236fe8242c0029"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/ca032cc56976d88b85e7386b17020bc6dc95dbc5",
- "reference": "ca032cc56976d88b85e7386b17020bc6dc95dbc5",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/d6825c6bb2f1da13f564678f9f236fe8242c0029",
+ "reference": "d6825c6bb2f1da13f564678f9f236fe8242c0029",
"shasum": ""
},
"require": {
@@ -3940,20 +3947,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
- "time": "2017-01-21T17:06:35+00:00"
+ "time": "2017-02-16T22:46:52+00:00"
},
{
"name": "symfony/var-dumper",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
- "reference": "5bb4435a03a4f05c211f4a9a8ee2756965924511"
+ "reference": "cb50260b674ee1c2d4ab49f2395a42e0b4681e20"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/5bb4435a03a4f05c211f4a9a8ee2756965924511",
- "reference": "5bb4435a03a4f05c211f4a9a8ee2756965924511",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/cb50260b674ee1c2d4ab49f2395a42e0b4681e20",
+ "reference": "cb50260b674ee1c2d4ab49f2395a42e0b4681e20",
"shasum": ""
},
"require": {
@@ -4003,7 +4010,7 @@
"debug",
"dump"
],
- "time": "2017-01-24T12:58:58+00:00"
+ "time": "2017-02-16T22:46:52+00:00"
},
{
"name": "themattharris/tmhoauth",
@@ -4298,6 +4305,55 @@
],
"time": "2015-06-14T21:17:01+00:00"
},
+ {
+ "name": "facebook/webdriver",
+ "version": "1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/facebook/php-webdriver.git",
+ "reference": "77300c4ab2025d4316635f592ec849ca7323bd8c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/77300c4ab2025d4316635f592ec849ca7323bd8c",
+ "reference": "77300c4ab2025d4316635f592ec849ca7323bd8c",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "php": "^5.5 || ~7.0",
+ "symfony/process": "^2.8 || ^3.1"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^1.11",
+ "php-mock/php-mock-phpunit": "^1.1",
+ "phpunit/phpunit": "4.6.* || ~5.0",
+ "satooshi/php-coveralls": "^1.0",
+ "squizlabs/php_codesniffer": "^2.6"
+ },
+ "suggest": {
+ "phpdocumentor/phpdocumentor": "2.*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Facebook\\WebDriver\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "description": "A PHP client for WebDriver",
+ "homepage": "https://github.com/facebook/php-webdriver",
+ "keywords": [
+ "facebook",
+ "php",
+ "selenium",
+ "webdriver"
+ ],
+ "time": "2017-01-13T15:48:08+00:00"
+ },
{
"name": "fzaninotto/faker",
"version": "v1.6.0",
@@ -4439,23 +4495,30 @@
"time": "2015-12-15T10:42:16+00:00"
},
{
- "name": "laravel/browser-kit-testing",
- "version": "v1.0.3",
+ "name": "laravel/dusk",
+ "version": "v1.0.9",
"source": {
"type": "git",
- "url": "https://github.com/laravel/browser-kit-testing.git",
- "reference": "0adfb725147815bff5516d157577f375a6e66ebd"
+ "url": "https://github.com/laravel/dusk.git",
+ "reference": "9d7f1b76f1624d7ce39c93223960f1acff5ad075"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/browser-kit-testing/zipball/0adfb725147815bff5516d157577f375a6e66ebd",
- "reference": "0adfb725147815bff5516d157577f375a6e66ebd",
+ "url": "https://api.github.com/repos/laravel/dusk/zipball/9d7f1b76f1624d7ce39c93223960f1acff5ad075",
+ "reference": "9d7f1b76f1624d7ce39c93223960f1acff5ad075",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
- "symfony/css-selector": "~3.1",
- "symfony/dom-crawler": "~3.1"
+ "facebook/webdriver": "~1.0",
+ "illuminate/support": "~5.3",
+ "nesbot/carbon": "~1.20",
+ "php": ">=5.6.4",
+ "symfony/console": "~3.2",
+ "symfony/process": "~3.2"
+ },
+ "require-dev": {
+ "mockery/mockery": "^0.9.6",
+ "phpunit/phpunit": "^5.7"
},
"type": "library",
"extra": {
@@ -4465,7 +4528,7 @@
},
"autoload": {
"psr-4": {
- "Laravel\\BrowserKitTesting\\": "src/"
+ "Laravel\\Dusk\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -4478,12 +4541,13 @@
"email": "taylor@laravel.com"
}
],
- "description": "Provides backwards compatibility for BrowserKit testing in Laravel 5.4.",
+ "description": "Laravel Dusk provides simple end-to-end testing and browser automation.",
"keywords": [
"laravel",
- "testing"
+ "testing",
+ "webdriver"
],
- "time": "2017-02-08T22:32:37+00:00"
+ "time": "2017-03-01T15:57:17+00:00"
},
{
"name": "maximebf/debugbar",
@@ -4548,16 +4612,16 @@
},
{
"name": "mockery/mockery",
- "version": "0.9.8",
+ "version": "0.9.9",
"source": {
"type": "git",
"url": "https://github.com/padraic/mockery.git",
- "reference": "1e5e2ffdc4d71d7358ed58a6fdd30a4a0c506855"
+ "reference": "6fdb61243844dc924071d3404bb23994ea0b6856"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/padraic/mockery/zipball/1e5e2ffdc4d71d7358ed58a6fdd30a4a0c506855",
- "reference": "1e5e2ffdc4d71d7358ed58a6fdd30a4a0c506855",
+ "url": "https://api.github.com/repos/padraic/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856",
+ "reference": "6fdb61243844dc924071d3404bb23994ea0b6856",
"shasum": ""
},
"require": {
@@ -4609,7 +4673,7 @@
"test double",
"testing"
],
- "time": "2017-02-09T13:29:38+00:00"
+ "time": "2017-02-28T12:52:32+00:00"
},
{
"name": "myclabs/deep-copy",
@@ -4864,35 +4928,35 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "4.0.5",
+ "version": "4.0.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "c19cfc7cbb0e9338d8c469c7eedecc2a428b0971"
+ "reference": "09e2277d14ea467e5a984010f501343ef29ffc69"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c19cfc7cbb0e9338d8c469c7eedecc2a428b0971",
- "reference": "c19cfc7cbb0e9338d8c469c7eedecc2a428b0971",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/09e2277d14ea467e5a984010f501343ef29ffc69",
+ "reference": "09e2277d14ea467e5a984010f501343ef29ffc69",
"shasum": ""
},
"require": {
+ "ext-dom": "*",
+ "ext-xmlwriter": "*",
"php": "^5.6 || ^7.0",
- "phpunit/php-file-iterator": "~1.3",
- "phpunit/php-text-template": "~1.2",
- "phpunit/php-token-stream": "^1.4.2",
- "sebastian/code-unit-reverse-lookup": "~1.0",
+ "phpunit/php-file-iterator": "^1.3",
+ "phpunit/php-text-template": "^1.2",
+ "phpunit/php-token-stream": "^1.4.2 || ^2.0",
+ "sebastian/code-unit-reverse-lookup": "^1.0",
"sebastian/environment": "^1.3.2 || ^2.0",
- "sebastian/version": "~1.0|~2.0"
+ "sebastian/version": "^1.0 || ^2.0"
},
"require-dev": {
- "ext-xdebug": ">=2.1.4",
- "phpunit/phpunit": "^5.4"
+ "ext-xdebug": "^2.1.4",
+ "phpunit/phpunit": "^5.7"
},
"suggest": {
- "ext-dom": "*",
- "ext-xdebug": ">=2.4.0",
- "ext-xmlwriter": "*"
+ "ext-xdebug": "^2.5.1"
},
"type": "library",
"extra": {
@@ -4923,7 +4987,7 @@
"testing",
"xunit"
],
- "time": "2017-01-20T15:06:43+00:00"
+ "time": "2017-03-01T09:12:17+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -5015,25 +5079,30 @@
},
{
"name": "phpunit/php-timer",
- "version": "1.0.8",
+ "version": "1.0.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
- "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^5.3.3 || ^7.0"
},
"require-dev": {
- "phpunit/phpunit": "~4|~5"
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
"autoload": {
"classmap": [
"src/"
@@ -5055,20 +5124,20 @@
"keywords": [
"timer"
],
- "time": "2016-05-12T18:03:57+00:00"
+ "time": "2017-02-26T11:10:40+00:00"
},
{
"name": "phpunit/php-token-stream",
- "version": "1.4.9",
+ "version": "1.4.11",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b"
+ "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b",
- "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7",
+ "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7",
"shasum": ""
},
"require": {
@@ -5104,20 +5173,20 @@
"keywords": [
"tokenizer"
],
- "time": "2016-11-15T14:06:22+00:00"
+ "time": "2017-02-27T10:12:30+00:00"
},
{
"name": "phpunit/phpunit",
- "version": "5.7.13",
+ "version": "5.7.15",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "60ebeed87a35ea46fd7f7d8029df2d6f013ebb34"
+ "reference": "b99112aecc01f62acf3d81a3f59646700a1849e5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/60ebeed87a35ea46fd7f7d8029df2d6f013ebb34",
- "reference": "60ebeed87a35ea46fd7f7d8029df2d6f013ebb34",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b99112aecc01f62acf3d81a3f59646700a1849e5",
+ "reference": "b99112aecc01f62acf3d81a3f59646700a1849e5",
"shasum": ""
},
"require": {
@@ -5141,7 +5210,7 @@
"sebastian/global-state": "^1.1",
"sebastian/object-enumerator": "~2.0",
"sebastian/resource-operations": "~1.0",
- "sebastian/version": "~1.0|~2.0",
+ "sebastian/version": "~1.0.3|~2.0",
"symfony/yaml": "~2.1|~3.0"
},
"conflict": {
@@ -5186,7 +5255,7 @@
"testing",
"xunit"
],
- "time": "2017-02-10T09:05:10+00:00"
+ "time": "2017-03-02T15:22:43+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
@@ -5578,16 +5647,16 @@
},
{
"name": "sebastian/object-enumerator",
- "version": "2.0.0",
+ "version": "2.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35"
+ "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35",
- "reference": "96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
+ "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
"shasum": ""
},
"require": {
@@ -5620,7 +5689,7 @@
],
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
- "time": "2016-11-19T07:35:10+00:00"
+ "time": "2017-02-18T15:18:39+00:00"
},
{
"name": "sebastian/recursion-context",
@@ -5760,74 +5829,18 @@
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2016-10-03T07:35:21+00:00"
},
- {
- "name": "symfony/dom-crawler",
- "version": "v3.1.10",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/dom-crawler.git",
- "reference": "7eede2a901a19928494194f7d1815a77b9a473a0"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/7eede2a901a19928494194f7d1815a77b9a473a0",
- "reference": "7eede2a901a19928494194f7d1815a77b9a473a0",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9",
- "symfony/polyfill-mbstring": "~1.0"
- },
- "require-dev": {
- "symfony/css-selector": "~2.8|~3.0"
- },
- "suggest": {
- "symfony/css-selector": ""
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.1-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\DomCrawler\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony DomCrawler Component",
- "homepage": "https://symfony.com",
- "time": "2017-01-21T17:13:55+00:00"
- },
{
"name": "symfony/yaml",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "e1718c6bf57e1efbb8793ada951584b2ab27775b"
+ "reference": "9724c684646fcb5387d579b4bfaa63ee0b0c64c8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/e1718c6bf57e1efbb8793ada951584b2ab27775b",
- "reference": "e1718c6bf57e1efbb8793ada951584b2ab27775b",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/9724c684646fcb5387d579b4bfaa63ee0b0c64c8",
+ "reference": "9724c684646fcb5387d579b4bfaa63ee0b0c64c8",
"shasum": ""
},
"require": {
@@ -5869,7 +5882,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2017-01-21T17:06:35+00:00"
+ "time": "2017-02-16T22:46:52+00:00"
},
{
"name": "webmozart/assert",
@@ -5930,8 +5943,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "ext-intl": "*",
- "php": ">=7.0.0"
+ "php": ">=7.1.0"
},
"platform-dev": []
}
diff --git a/config/admin.php b/config/admin.php
new file mode 100644
index 00000000..9e778544
--- /dev/null
+++ b/config/admin.php
@@ -0,0 +1,25 @@
+ env('ADMIN_USER'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Admin Password
+ |--------------------------------------------------------------------------
+ |
+ | The password of the admin account.
+ */
+
+ 'pass' => env('ADMIN_PASS'),
+
+];
diff --git a/config/app.php b/config/app.php
index ed3364de..57d672d9 100644
--- a/config/app.php
+++ b/config/app.php
@@ -53,6 +53,17 @@ return [
'url' => env('APP_URL', 'http://localhost'),
+ /*
+ |--------------------------------------------------------------------------
+ | Application Long URL
+ |--------------------------------------------------------------------------
+ |
+ | The short URL for the application
+ |
+ */
+
+ 'longurl' => env('APP_LONGURL', 'longurl.local'),
+
/*
|--------------------------------------------------------------------------
| Application Short URL
@@ -62,7 +73,18 @@ return [
|
*/
- 'shorturl' => env('APP_SHORTURL', 'http://shorturl.local'),
+ 'shorturl' => env('APP_SHORTURL', 'shorturl.local'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Application Display Name
+ |--------------------------------------------------------------------------
+ |
+ | The display name for the application, used for example in titles.
+ |
+ */
+
+ 'display_name' => env('DISPLAY_NAME', 'Joe Bloggs'),
/*
|--------------------------------------------------------------------------
diff --git a/config/session.php b/config/session.php
index cb7ff016..2ea2eed5 100644
--- a/config/session.php
+++ b/config/session.php
@@ -161,7 +161,7 @@ return [
|
*/
- 'secure' => true,
+ 'secure' => (config('app.env') != 'testing'),
/*
|--------------------------------------------------------------------------
diff --git a/deploy.sh b/deploy.sh
new file mode 100755
index 00000000..c1eab083
--- /dev/null
+++ b/deploy.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+echo "Putting the Laravel app in maintenance mode"
+php artisan down
+
+echo "Updating composer dependencies"
+composer install
+
+echo "Caching Laravel route and config files"
+php artisan route:cache
+php artisan config:cache
+
+echo "Restarting the queue daemon"
+sudo systemctl restart supervisorctl
+
+echo "Bringing the Laravel app back online"
+php artisan up
diff --git a/phpunit.xml b/phpunit.xml
index 3e884d17..88860829 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -9,16 +9,16 @@
processIsolation="false"
stopOnFailure="false">
r.x)&&S(n,t)&&(r=n,h=u)),n=n.next;return r}function m(t,e,r,n){var i=t;do null===i.z&&(i.z=v(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,y(i)}function y(t){var e,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return null==t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function b(t){return void 0===t}function w(t){return E(t)&&"[object RegExp]"===M(t)}function E(t){return"object"==typeof t&&null!==t}function T(t){return E(t)&&"[object Date]"===M(t)}function S(t){return E(t)&&("[object Error]"===M(t)||t instanceof Error)}function z(t){return"function"==typeof t}function A(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function M(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}function I(){var t=new Date,e=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":");return[t.getDate(),D[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;n.format=function(t){if(!_(t)){for(var e=[],r=0;r0){var C=v.dist(g);if(C>2*l){var k=v.sub(v.sub(g)._mult(l/C)._round());a.distance+=k.dist(g),a.addCurrentVertex(k,a.distance,x.mult(1),0,0,!1,y),g=k}}var R=g&&_,D=R?r:_?T:S;if(R&&"round"===D&&(L