commit
1dd5cdd327
62 changed files with 1372 additions and 1278 deletions
|
@ -21,7 +21,7 @@ class Kernel extends ConsoleKernel
|
||||||
/**
|
/**
|
||||||
* Define the application's command schedule.
|
* Define the application's command schedule.
|
||||||
*
|
*
|
||||||
* @param Schedule $schedule
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
|
|
|
@ -46,6 +46,7 @@ class Handler extends ExceptionHandler
|
||||||
* @param Throwable $throwable
|
* @param Throwable $throwable
|
||||||
* @return void
|
* @return void
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
public function report(Throwable $throwable)
|
public function report(Throwable $throwable)
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,16 +37,6 @@ class ShortURLsController extends Controller
|
||||||
return redirect('https://twitter.com/jonnybarnes');
|
return redirect('https://twitter.com/jonnybarnes');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Redirect from '/+' to a Google+ profile.
|
|
||||||
*
|
|
||||||
* @return RedirectResponse
|
|
||||||
*/
|
|
||||||
public function googlePlus(): RedirectResponse
|
|
||||||
{
|
|
||||||
return redirect('https://plus.google.com/u/0/117317270900655269082/about');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redirect a short url of this site out to a long one based on post type.
|
* Redirect a short url of this site out to a long one based on post type.
|
||||||
* Further redirects may happen.
|
* Further redirects may happen.
|
||||||
|
|
|
@ -14,8 +14,10 @@ class Kernel extends HttpKernel
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $middleware = [
|
protected $middleware = [
|
||||||
|
// \App\Http\Middleware\TrustHosts::class,
|
||||||
\App\Http\Middleware\TrustProxies::class,
|
\App\Http\Middleware\TrustProxies::class,
|
||||||
\App\Http\Middleware\CheckForMaintenanceMode::class,
|
\Fruitcake\Cors\HandleCors::class,
|
||||||
|
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
|
||||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||||
\App\Http\Middleware\TrimStrings::class,
|
\App\Http\Middleware\TrimStrings::class,
|
||||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||||
|
@ -42,8 +44,8 @@ class Kernel extends HttpKernel
|
||||||
],
|
],
|
||||||
|
|
||||||
'api' => [
|
'api' => [
|
||||||
'throttle:60,1',
|
'throttle:api',
|
||||||
'bindings',
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -57,10 +59,10 @@ class Kernel extends HttpKernel
|
||||||
protected $routeMiddleware = [
|
protected $routeMiddleware = [
|
||||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
|
||||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||||
|
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||||
|
@ -68,20 +70,4 @@ class Kernel extends HttpKernel
|
||||||
'myauth' => \App\Http\Middleware\MyAuthMiddleware::class,
|
'myauth' => \App\Http\Middleware\MyAuthMiddleware::class,
|
||||||
'cors' => \App\Http\Middleware\CorsHeaders::class,
|
'cors' => \App\Http\Middleware\CorsHeaders::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* The priority-sorted list of middleware.
|
|
||||||
*
|
|
||||||
* This forces non-global middleware to always be in the given order.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $middlewarePriority = [
|
|
||||||
\Illuminate\Session\Middleware\StartSession::class,
|
|
||||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
|
||||||
\App\Http\Middleware\Authenticate::class,
|
|
||||||
\Illuminate\Session\Middleware\AuthenticateSession::class,
|
|
||||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
|
||||||
\Illuminate\Auth\Middleware\Authorize::class,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
17
app/Http/Middleware/PreventRequestsDuringMaintenance.php
Normal file
17
app/Http/Middleware/PreventRequestsDuringMaintenance.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
|
||||||
|
|
||||||
|
class PreventRequestsDuringMaintenance extends Middleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The URIs that should be reachable while maintenance mode is enabled.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $except = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
|
@ -2,12 +2,11 @@
|
||||||
|
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use App\Providers\RouteServiceProvider;
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
*/
|
|
||||||
class RedirectIfAuthenticated
|
class RedirectIfAuthenticated
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -15,13 +14,17 @@ class RedirectIfAuthenticated
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
* @param string|null $guard
|
* @param string|null ...$guards
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next, $guard = null)
|
public function handle(Request $request, Closure $next, ...$guards)
|
||||||
{
|
{
|
||||||
if (Auth::guard($guard)->check()) {
|
$guards = empty($guards) ? [null] : $guards;
|
||||||
return redirect('/home');
|
|
||||||
|
foreach ($guards as $guard) {
|
||||||
|
if (Auth::guard($guard)->check()) {
|
||||||
|
return redirect(RouteServiceProvider::HOME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|
20
app/Http/Middleware/TrustHosts.php
Normal file
20
app/Http/Middleware/TrustHosts.php
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||||
|
|
||||||
|
class TrustHosts extends Middleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the host patterns that should be trusted.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function hosts()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
$this->allSubdomainsOfApplicationUrl(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ namespace App\Models;
|
||||||
use Eloquent;
|
use Eloquent;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
@ -42,6 +43,8 @@ use Illuminate\Support\Carbon;
|
||||||
*/
|
*/
|
||||||
class Bookmark extends Model
|
class Bookmark extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,6 +7,7 @@ namespace App\Models;
|
||||||
use App\Traits\FilterHtml;
|
use App\Traits\FilterHtml;
|
||||||
use Eloquent;
|
use Eloquent;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
@ -37,6 +38,7 @@ use Mf2;
|
||||||
class Like extends Model
|
class Like extends Model
|
||||||
{
|
{
|
||||||
use FilterHtml;
|
use FilterHtml;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
protected $fillable = ['url'];
|
protected $fillable = ['url'];
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ namespace App\Models;
|
||||||
use Eloquent;
|
use Eloquent;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
@ -33,6 +34,8 @@ use Illuminate\Support\Carbon;
|
||||||
*/
|
*/
|
||||||
class MicropubClient extends Model
|
class MicropubClient extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The table associated with the model.
|
* The table associated with the model.
|
||||||
*
|
*
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Eloquent;
|
||||||
use Exception;
|
use Exception;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use Illuminate\Database\Eloquent\Relations\{BelongsTo, BelongsToMany, HasMany, MorphMany};
|
use Illuminate\Database\Eloquent\Relations\{BelongsTo, BelongsToMany, HasMany, MorphMany};
|
||||||
use Illuminate\Database\Eloquent\{Builder, Collection, Model, SoftDeletes};
|
use Illuminate\Database\Eloquent\{Builder, Collection, Factories\HasFactory, Model, SoftDeletes};
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Jonnybarnes\IndieWeb\Numbers;
|
use Jonnybarnes\IndieWeb\Numbers;
|
||||||
|
@ -88,6 +88,7 @@ use Spatie\CommonMarkHighlighter\{FencedCodeRenderer, IndentedCodeRenderer};
|
||||||
*/
|
*/
|
||||||
class Note extends Model
|
class Note extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
use Searchable;
|
use Searchable;
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace App\Models;
|
||||||
use Cviebrock\EloquentSluggable\Sluggable;
|
use Cviebrock\EloquentSluggable\Sluggable;
|
||||||
use Eloquent;
|
use Eloquent;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\{Builder, Collection, Model};
|
use Illuminate\Database\Eloquent\{Builder, Collection, Factories\HasFactory, Model};
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@ use Illuminate\Support\Str;
|
||||||
*/
|
*/
|
||||||
class Place extends Model
|
class Place extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
use Sluggable;
|
use Sluggable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,6 +7,7 @@ namespace App\Models;
|
||||||
use Eloquent;
|
use Eloquent;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
@ -33,6 +34,8 @@ use Illuminate\Support\Carbon;
|
||||||
*/
|
*/
|
||||||
class Tag extends Model
|
class Tag extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We shall set a blacklist of non-modifiable model attributes.
|
* We shall set a blacklist of non-modifiable model attributes.
|
||||||
*
|
*
|
||||||
|
|
|
@ -6,6 +6,7 @@ namespace App\Models;
|
||||||
|
|
||||||
use Eloquent;
|
use Eloquent;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\DatabaseNotification;
|
use Illuminate\Notifications\DatabaseNotification;
|
||||||
use Illuminate\Notifications\DatabaseNotificationCollection;
|
use Illuminate\Notifications\DatabaseNotificationCollection;
|
||||||
|
@ -36,6 +37,7 @@ use Illuminate\Support\Carbon;
|
||||||
*/
|
*/
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
use Notifiable;
|
use Notifiable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,7 +12,7 @@ class AuthServiceProvider extends ServiceProvider
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $policies = [
|
protected $policies = [
|
||||||
// 'App\Model' => 'App\Policies\ModelPolicy',
|
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Cache\RateLimiting\Limit;
|
||||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\RateLimiter;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
class RouteServiceProvider extends ServiceProvider
|
class RouteServiceProvider extends ServiceProvider
|
||||||
|
@ -12,9 +15,9 @@ class RouteServiceProvider extends ServiceProvider
|
||||||
*
|
*
|
||||||
* In addition, it is set as the URL generator's root namespace.
|
* In addition, it is set as the URL generator's root namespace.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string|null
|
||||||
*/
|
*/
|
||||||
protected $namespace = 'App\Http\Controllers';
|
// protected $namespace = 'App\Http\Controllers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define your route model bindings, pattern filters, etc.
|
* Define your route model bindings, pattern filters, etc.
|
||||||
|
@ -23,51 +26,29 @@ class RouteServiceProvider extends ServiceProvider
|
||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
//
|
$this->configureRateLimiting();
|
||||||
|
|
||||||
parent::boot();
|
$this->routes(function () {
|
||||||
|
Route::prefix('api')
|
||||||
|
->middleware('api')
|
||||||
|
->namespace($this->namespace)
|
||||||
|
->group(base_path('routes/api.php'));
|
||||||
|
|
||||||
|
Route::middleware('web')
|
||||||
|
->namespace($this->namespace)
|
||||||
|
->group(base_path('routes/web.php'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the routes for the application.
|
* Configure the rate limiters for the application.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function map()
|
protected function configureRateLimiting()
|
||||||
{
|
{
|
||||||
$this->mapApiRoutes();
|
RateLimiter::for('api', function (Request $request) {
|
||||||
|
return Limit::perMinute(60);
|
||||||
$this->mapWebRoutes();
|
});
|
||||||
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define the "web" routes for the application.
|
|
||||||
*
|
|
||||||
* These routes all receive session state, CSRF protection, etc.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function mapWebRoutes()
|
|
||||||
{
|
|
||||||
Route::middleware('web')
|
|
||||||
->namespace($this->namespace)
|
|
||||||
->group(base_path('routes/web.php'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define the "api" routes for the application.
|
|
||||||
*
|
|
||||||
* These routes are typically stateless.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function mapApiRoutes()
|
|
||||||
{
|
|
||||||
Route::prefix('api')
|
|
||||||
->middleware('api')
|
|
||||||
->namespace($this->namespace)
|
|
||||||
->group(base_path('routes/api.php'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "jonnybarnes/jonnybarnes.uk",
|
"name": "jonnybarnes/jonnybarnes.uk",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"description": "The code for jonnybarnes.uk, based on Laravel 5.8",
|
"description": "The code for jonnybarnes.uk, based on Laravel 8",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"framework",
|
"framework",
|
||||||
"laravel",
|
"laravel",
|
||||||
|
@ -13,18 +13,19 @@
|
||||||
"ext-intl": "*",
|
"ext-intl": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-dom": "*",
|
"ext-dom": "*",
|
||||||
"cviebrock/eloquent-sluggable": "~7.0",
|
"cviebrock/eloquent-sluggable": "^8.0",
|
||||||
"fideloper/proxy": "~4.0",
|
"fideloper/proxy": "~4.0",
|
||||||
"guzzlehttp/guzzle": "~6.0",
|
"fruitcake/laravel-cors": "^2.0",
|
||||||
|
"guzzlehttp/guzzle": "^7.0.1",
|
||||||
"indieauth/client": "~0.1",
|
"indieauth/client": "~0.1",
|
||||||
"intervention/image": "^2.4",
|
"intervention/image": "^2.4",
|
||||||
"jonnybarnes/indieweb": "~0.2",
|
"jonnybarnes/indieweb": "~0.2",
|
||||||
"jonnybarnes/webmentions-parser": "~0.5",
|
"jonnybarnes/webmentions-parser": "~0.5",
|
||||||
"jublonet/codebird-php": "4.0.0-beta.1",
|
"jublonet/codebird-php": "4.0.0-beta.1",
|
||||||
"laravel/framework": "^7.0",
|
"laravel/framework": "^8.0",
|
||||||
"laravel/horizon": "^4.0",
|
"laravel/horizon": "^5.0",
|
||||||
"laravel/scout": "^8.0",
|
"laravel/scout": "^8.0",
|
||||||
"laravel/telescope": "^3.0",
|
"laravel/telescope": "^4.0",
|
||||||
"laravel/tinker": "^2.0",
|
"laravel/tinker": "^2.0",
|
||||||
"lcobucci/jwt": "^3.1",
|
"lcobucci/jwt": "^3.1",
|
||||||
"league/commonmark": "^1.0",
|
"league/commonmark": "^1.0",
|
||||||
|
@ -32,7 +33,6 @@
|
||||||
"mf2/mf2": "~0.3",
|
"mf2/mf2": "~0.3",
|
||||||
"pmatseykanets/laravel-scout-postgres": "^7.0",
|
"pmatseykanets/laravel-scout-postgres": "^7.0",
|
||||||
"predis/predis": "~1.0",
|
"predis/predis": "~1.0",
|
||||||
"ramsey/uuid": "^3.5",
|
|
||||||
"sensiolabs/security-checker": "^6.0",
|
"sensiolabs/security-checker": "^6.0",
|
||||||
"spatie/browsershot": "~3.0",
|
"spatie/browsershot": "~3.0",
|
||||||
"spatie/commonmark-highlighter": "^2.0",
|
"spatie/commonmark-highlighter": "^2.0",
|
||||||
|
@ -42,11 +42,11 @@
|
||||||
"barryvdh/laravel-debugbar": "^3.0",
|
"barryvdh/laravel-debugbar": "^3.0",
|
||||||
"barryvdh/laravel-ide-helper": "^2.6",
|
"barryvdh/laravel-ide-helper": "^2.6",
|
||||||
"beyondcode/laravel-dump-server": "^1.0",
|
"beyondcode/laravel-dump-server": "^1.0",
|
||||||
"facade/ignition": "^2.0",
|
"facade/ignition": "^2.3.6",
|
||||||
"fzaninotto/faker": "^1.9.1",
|
"fzaninotto/faker": "^1.9.1",
|
||||||
"laravel/dusk": "^6.0",
|
"laravel/dusk": "^6.0",
|
||||||
"mockery/mockery": "^1.0",
|
"mockery/mockery": "^1.0",
|
||||||
"nunomaduro/collision": "^4.1",
|
"nunomaduro/collision": "^5.0",
|
||||||
"phpunit/phpunit": "^9.0",
|
"phpunit/phpunit": "^9.0",
|
||||||
"vimeo/psalm": "^3.9"
|
"vimeo/psalm": "^3.9"
|
||||||
},
|
},
|
||||||
|
@ -62,12 +62,10 @@
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"App\\": "app/"
|
"App\\": "app/",
|
||||||
|
"Database\\Factories\\": "database/factories/",
|
||||||
|
"Database\\Seeders\\": "database/seeders/"
|
||||||
},
|
},
|
||||||
"classmap": [
|
|
||||||
"database/seeds",
|
|
||||||
"database/factories"
|
|
||||||
],
|
|
||||||
"files": [
|
"files": [
|
||||||
"helpers.php"
|
"helpers.php"
|
||||||
]
|
]
|
||||||
|
|
1445
composer.lock
generated
1445
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -22,7 +22,7 @@ return [
|
||||||
|
|
|
|
||||||
| This value determines the "environment" your application is currently
|
| This value determines the "environment" your application is currently
|
||||||
| running in. This may determine how you prefer to configure various
|
| running in. This may determine how you prefer to configure various
|
||||||
| services your application utilizes. Set this in your ".env" file.
|
| services the application utilizes. Set this in your ".env" file.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'debug' => env('APP_DEBUG', false),
|
'debug' => (bool) env('APP_DEBUG', false),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -207,6 +207,10 @@ return [
|
||||||
Illuminate\Validation\ValidationServiceProvider::class,
|
Illuminate\Validation\ValidationServiceProvider::class,
|
||||||
Illuminate\View\ViewServiceProvider::class,
|
Illuminate\View\ViewServiceProvider::class,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Package Service Providers...
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Application Service Providers...
|
* Application Service Providers...
|
||||||
*/
|
*/
|
||||||
|
@ -238,6 +242,7 @@ return [
|
||||||
'Artisan' => Illuminate\Support\Facades\Artisan::class,
|
'Artisan' => Illuminate\Support\Facades\Artisan::class,
|
||||||
'Auth' => Illuminate\Support\Facades\Auth::class,
|
'Auth' => Illuminate\Support\Facades\Auth::class,
|
||||||
'Blade' => Illuminate\Support\Facades\Blade::class,
|
'Blade' => Illuminate\Support\Facades\Blade::class,
|
||||||
|
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
|
||||||
'Bus' => Illuminate\Support\Facades\Bus::class,
|
'Bus' => Illuminate\Support\Facades\Bus::class,
|
||||||
'Cache' => Illuminate\Support\Facades\Cache::class,
|
'Cache' => Illuminate\Support\Facades\Cache::class,
|
||||||
'Config' => Illuminate\Support\Facades\Config::class,
|
'Config' => Illuminate\Support\Facades\Config::class,
|
||||||
|
@ -249,6 +254,7 @@ return [
|
||||||
'File' => Illuminate\Support\Facades\File::class,
|
'File' => Illuminate\Support\Facades\File::class,
|
||||||
'Gate' => Illuminate\Support\Facades\Gate::class,
|
'Gate' => Illuminate\Support\Facades\Gate::class,
|
||||||
'Hash' => Illuminate\Support\Facades\Hash::class,
|
'Hash' => Illuminate\Support\Facades\Hash::class,
|
||||||
|
'Http' => Illuminate\Support\Facades\Http::class,
|
||||||
'Lang' => Illuminate\Support\Facades\Lang::class,
|
'Lang' => Illuminate\Support\Facades\Lang::class,
|
||||||
'Log' => Illuminate\Support\Facades\Log::class,
|
'Log' => Illuminate\Support\Facades\Log::class,
|
||||||
'Mail' => Illuminate\Support\Facades\Mail::class,
|
'Mail' => Illuminate\Support\Facades\Mail::class,
|
||||||
|
|
|
@ -44,6 +44,7 @@ return [
|
||||||
'api' => [
|
'api' => [
|
||||||
'driver' => 'token',
|
'driver' => 'token',
|
||||||
'provider' => 'users',
|
'provider' => 'users',
|
||||||
|
'hash' => false,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -96,7 +97,21 @@ return [
|
||||||
'provider' => 'users',
|
'provider' => 'users',
|
||||||
'table' => 'password_resets',
|
'table' => 'password_resets',
|
||||||
'expire' => 60,
|
'expire' => 60,
|
||||||
|
'throttle' => 60,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Password Confirmation Timeout
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may define the amount of seconds before a password confirmation
|
||||||
|
| times out and the user is prompted to re-enter their password via the
|
||||||
|
| confirmation screen. By default, the timeout lasts for three hours.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'password_timeout' => 10800,
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -39,6 +39,7 @@ return [
|
||||||
|
|
||||||
'array' => [
|
'array' => [
|
||||||
'driver' => 'array',
|
'driver' => 'array',
|
||||||
|
'serialize' => false,
|
||||||
],
|
],
|
||||||
|
|
||||||
'database' => [
|
'database' => [
|
||||||
|
@ -73,7 +74,7 @@ return [
|
||||||
|
|
||||||
'redis' => [
|
'redis' => [
|
||||||
'driver' => 'redis',
|
'driver' => 'redis',
|
||||||
'connection' => 'default',
|
'connection' => 'cache',
|
||||||
],
|
],
|
||||||
|
|
||||||
'dynamodb' => [
|
'dynamodb' => [
|
||||||
|
@ -98,6 +99,6 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'),
|
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -46,7 +46,7 @@ return [
|
||||||
'mysql' => [
|
'mysql' => [
|
||||||
'driver' => 'mysql',
|
'driver' => 'mysql',
|
||||||
'url' => env('DATABASE_URL'),
|
'url' => env('DATABASE_URL'),
|
||||||
'host' => env('DB_HOST', 'localhost'),
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
'port' => env('DB_PORT', '3306'),
|
'port' => env('DB_PORT', '3306'),
|
||||||
'database' => env('DB_DATABASE', 'forge'),
|
'database' => env('DB_DATABASE', 'forge'),
|
||||||
'username' => env('DB_USERNAME', 'forge'),
|
'username' => env('DB_USERNAME', 'forge'),
|
||||||
|
@ -66,7 +66,7 @@ return [
|
||||||
'pgsql' => [
|
'pgsql' => [
|
||||||
'driver' => 'pgsql',
|
'driver' => 'pgsql',
|
||||||
'url' => env('DATABASE_URL'),
|
'url' => env('DATABASE_URL'),
|
||||||
'host' => env('DB_HOST', 'localhost'),
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
'port' => env('DB_PORT', '5432'),
|
'port' => env('DB_PORT', '5432'),
|
||||||
'database' => env('DB_DATABASE', 'forge'),
|
'database' => env('DB_DATABASE', 'forge'),
|
||||||
'username' => env('DB_USERNAME', 'forge'),
|
'username' => env('DB_USERNAME', 'forge'),
|
||||||
|
@ -91,17 +91,6 @@ return [
|
||||||
'prefix_indexes' => true,
|
'prefix_indexes' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'travis' => [
|
|
||||||
'driver' => 'pgsql',
|
|
||||||
'host' => 'localhost',
|
|
||||||
'database' => 'travis_ci_test',
|
|
||||||
'username' => 'travis',
|
|
||||||
'password' => '',
|
|
||||||
'charset' => 'utf8',
|
|
||||||
'prefix' => '',
|
|
||||||
'schema' => 'public',
|
|
||||||
]
|
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -134,23 +123,23 @@ return [
|
||||||
|
|
||||||
'options' => [
|
'options' => [
|
||||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||||
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
|
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'default' => [
|
'default' => [
|
||||||
'url' => env('REDIS_URL'),
|
'url' => env('REDIS_URL'),
|
||||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||||
'password' => env('REDIS_PASSWORD', null),
|
'password' => env('REDIS_PASSWORD', null),
|
||||||
'port' => env('REDIS_PORT', 6379),
|
'port' => env('REDIS_PORT', '6379'),
|
||||||
'database' => env('REDIS_DB', 0),
|
'database' => env('REDIS_DB', '0'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'cache' => [
|
'cache' => [
|
||||||
'url' => env('REDIS_URL'),
|
'url' => env('REDIS_URL'),
|
||||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||||
'password' => env('REDIS_PASSWORD', null),
|
'password' => env('REDIS_PASSWORD', null),
|
||||||
'port' => env('REDIS_PORT', 6379),
|
'port' => env('REDIS_PORT', '6379'),
|
||||||
'database' => env('REDIS_CACHE_DB', 1),
|
'database' => env('REDIS_CACHE_DB', '1'),
|
||||||
],
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
|
@ -8,8 +8,8 @@ return [
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Here you may specify the default filesystem disk that should be used
|
| Here you may specify the default filesystem disk that should be used
|
||||||
| by the framework. A "local" driver, as well as a variety of cloud
|
| by the framework. The "local" disk, as well as a variety of cloud
|
||||||
| based drivers are available for your choosing. Just store away!
|
| based disks are available to your application. Just store away!
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ return [
|
||||||
| may even configure multiple disks of the same driver. Defaults have
|
| may even configure multiple disks of the same driver. Defaults have
|
||||||
| been setup for each driver as an example of the required options.
|
| been setup for each driver as an example of the required options.
|
||||||
|
|
|
|
||||||
| Supported Drivers: "local", "ftp", "s3", "rackspace"
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -57,11 +57,12 @@ return [
|
||||||
|
|
||||||
's3' => [
|
's3' => [
|
||||||
'driver' => 's3',
|
'driver' => 's3',
|
||||||
'key' => env('AWS_S3_KEY'),
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
'secret' => env('AWS_S3_SECRET'),
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
'region' => env('AWS_S3_REGION'),
|
'region' => env('AWS_DEFAULT_REGION'),
|
||||||
'bucket' => env('AWS_S3_BUCKET'),
|
'bucket' => env('AWS_BUCKET'),
|
||||||
'url' => env('AWS_S3_URL'),
|
'url' => env('AWS_URL'),
|
||||||
|
'endpoint' => env('AWS_ENDPOINT'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'media' => [
|
'media' => [
|
||||||
|
@ -71,4 +72,19 @@ return [
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Symbolic Links
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the symbolic links that will be created when the
|
||||||
|
| `storage:link` Artisan command is executed. The array keys should be
|
||||||
|
| the locations of the links and the values should be their targets.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'links' => [
|
||||||
|
public_path('storage') => storage_path('app/public'),
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -27,9 +27,11 @@ return [
|
||||||
| to control the amount of time it takes to hash the given password.
|
| to control the amount of time it takes to hash the given password.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'bcrypt' => [
|
'bcrypt' => [
|
||||||
'rounds' => env('BCRYPT_ROUNDS', 10),
|
'rounds' => env('BCRYPT_ROUNDS', 10),
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Argon Options
|
| Argon Options
|
||||||
|
@ -40,6 +42,7 @@ return [
|
||||||
| to control the amount of time it takes to hash the given password.
|
| to control the amount of time it takes to hash the given password.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'argon' => [
|
'argon' => [
|
||||||
'memory' => 1024,
|
'memory' => 1024,
|
||||||
'threads' => 2,
|
'threads' => 2,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return array(
|
return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -15,6 +15,6 @@ return array(
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'driver' => 'imagick'
|
'driver' => 'imagick',
|
||||||
|
|
||||||
);
|
];
|
||||||
|
|
|
@ -37,20 +37,20 @@ return [
|
||||||
'channels' => [
|
'channels' => [
|
||||||
'stack' => [
|
'stack' => [
|
||||||
'driver' => 'stack',
|
'driver' => 'stack',
|
||||||
'channels' => ['daily'],
|
'channels' => ['single'],
|
||||||
'ignore_exceptions' => false,
|
'ignore_exceptions' => false,
|
||||||
],
|
],
|
||||||
|
|
||||||
'single' => [
|
'single' => [
|
||||||
'driver' => 'single',
|
'driver' => 'single',
|
||||||
'path' => storage_path('logs/laravel.log'),
|
'path' => storage_path('logs/laravel.log'),
|
||||||
'level' => 'debug',
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'daily' => [
|
'daily' => [
|
||||||
'driver' => 'daily',
|
'driver' => 'daily',
|
||||||
'path' => storage_path('logs/laravel.log'),
|
'path' => storage_path('logs/laravel.log'),
|
||||||
'level' => 'debug',
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
'days' => 14,
|
'days' => 14,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -59,12 +59,12 @@ return [
|
||||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||||
'username' => 'Laravel Log',
|
'username' => 'Laravel Log',
|
||||||
'emoji' => ':boom:',
|
'emoji' => ':boom:',
|
||||||
'level' => 'critical',
|
'level' => env('LOG_LEVEL', 'critical'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'papertrail' => [
|
'papertrail' => [
|
||||||
'driver' => 'monolog',
|
'driver' => 'monolog',
|
||||||
'level' => 'debug',
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
'handler' => SyslogUdpHandler::class,
|
'handler' => SyslogUdpHandler::class,
|
||||||
'handler_with' => [
|
'handler_with' => [
|
||||||
'host' => env('PAPERTRAIL_URL'),
|
'host' => env('PAPERTRAIL_URL'),
|
||||||
|
@ -83,18 +83,22 @@ return [
|
||||||
|
|
||||||
'syslog' => [
|
'syslog' => [
|
||||||
'driver' => 'syslog',
|
'driver' => 'syslog',
|
||||||
'level' => 'debug',
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'errorlog' => [
|
'errorlog' => [
|
||||||
'driver' => 'errorlog',
|
'driver' => 'errorlog',
|
||||||
'level' => 'debug',
|
'level' => env('LOG_LEVEL', 'debug'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'null' => [
|
'null' => [
|
||||||
'driver' => 'monolog',
|
'driver' => 'monolog',
|
||||||
'handler' => NullHandler::class,
|
'handler' => NullHandler::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'emergency' => [
|
||||||
|
'path' => storage_path('logs/laravel.log'),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'slack' => env('LOG_SLACK_WEBHOOK_URL'),
|
'slack' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||||
|
|
139
config/mail.php
139
config/mail.php
|
@ -4,45 +4,73 @@ return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Mail Driver
|
| Default Mailer
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
|
| This option controls the default mailer that is used to send any email
|
||||||
| sending of e-mail. You may specify which one you're using throughout
|
| messages sent by your application. Alternative mailers may be setup
|
||||||
| your application here. By default, Laravel is setup for SMTP mail.
|
| and used as needed; however, this mailer will be used by default.
|
||||||
|
|
|
|
||||||
| Supported: "smtp", "sendmail", "mailgun", "ses"
|
*/
|
||||||
|
|
||||||
|
'default' => env('MAIL_MAILER', 'smtp'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Mailer Configurations
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure all of the mailers used by your application plus
|
||||||
|
| their respective settings. Several examples have been configured for
|
||||||
|
| you and you are free to add your own as your application requires.
|
||||||
|
|
|
||||||
|
| Laravel supports a variety of mail "transport" drivers to be used while
|
||||||
|
| sending an e-mail. You will specify which one you are using for your
|
||||||
|
| mailers below. You are free to add additional mailers as required.
|
||||||
|
|
|
||||||
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
|
||||||
| "postmark", "log", "array"
|
| "postmark", "log", "array"
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'driver' => env('MAIL_DRIVER', 'smtp'),
|
'mailers' => [
|
||||||
|
'smtp' => [
|
||||||
|
'transport' => 'smtp',
|
||||||
|
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
|
||||||
|
'port' => env('MAIL_PORT', 587),
|
||||||
|
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
|
||||||
|
'username' => env('MAIL_USERNAME'),
|
||||||
|
'password' => env('MAIL_PASSWORD'),
|
||||||
|
'timeout' => null,
|
||||||
|
'auth_mode' => null,
|
||||||
|
],
|
||||||
|
|
||||||
/*
|
'ses' => [
|
||||||
|--------------------------------------------------------------------------
|
'transport' => 'ses',
|
||||||
| SMTP Host Address
|
],
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Here you may provide the host address of the SMTP server used by your
|
|
||||||
| applications. A default option is provided that is compatible with
|
|
||||||
| the Mailgun mail service which will provide reliable deliveries.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
|
'mailgun' => [
|
||||||
|
'transport' => 'mailgun',
|
||||||
|
],
|
||||||
|
|
||||||
/*
|
'postmark' => [
|
||||||
|--------------------------------------------------------------------------
|
'transport' => 'postmark',
|
||||||
| SMTP Host Port
|
],
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This is the SMTP port used by your application to deliver e-mails to
|
|
||||||
| users of the application. Like the host we have set this value to
|
|
||||||
| stay compatible with the Mailgun e-mail application by default.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'port' => env('MAIL_PORT', 587),
|
'sendmail' => [
|
||||||
|
'transport' => 'sendmail',
|
||||||
|
'path' => '/usr/sbin/sendmail -bs',
|
||||||
|
],
|
||||||
|
|
||||||
|
'log' => [
|
||||||
|
'transport' => 'log',
|
||||||
|
'channel' => env('MAIL_LOG_CHANNEL'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'array' => [
|
||||||
|
'transport' => 'array',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -54,52 +82,12 @@ return [
|
||||||
| used globally for all e-mails that are sent by your application.
|
| used globally for all e-mails that are sent by your application.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'from' => [
|
'from' => [
|
||||||
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
||||||
'name' => env('MAIL_FROM_NAME', 'Example'),
|
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| E-Mail Encryption Protocol
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Here you may specify the encryption protocol that should be used when
|
|
||||||
| the application send e-mail messages. A sensible default using the
|
|
||||||
| transport layer security protocol should provide great security.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| SMTP Server Username
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| If your SMTP server requires a username for authentication, you should
|
|
||||||
| set it here. This will get used to authenticate with your server on
|
|
||||||
| connection. You may also set the "password" value below this one.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'username' => env('MAIL_USERNAME'),
|
|
||||||
|
|
||||||
'password' => env('MAIL_PASSWORD'),
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Sendmail System Path
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| When using the "sendmail" driver to send e-mails, we will need to know
|
|
||||||
| the path to where Sendmail lives on this server. A default path has
|
|
||||||
| been provided here, which will work well on most of your systems.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Markdown Mail Settings
|
| Markdown Mail Settings
|
||||||
|
@ -119,17 +107,4 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Log Channel
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| If you are using the "log" driver, you may specify the logging channel
|
|
||||||
| if you prefer to keep mail messages separate from other log entries
|
|
||||||
| for simpler reading. Otherwise, the default channel will be used.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'log_channel' => env('MAIL_LOG_CHANNEL'),
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -51,11 +51,12 @@ return [
|
||||||
|
|
||||||
'sqs' => [
|
'sqs' => [
|
||||||
'driver' => 'sqs',
|
'driver' => 'sqs',
|
||||||
'key' => env('SQS_KEY', 'your-public-key'),
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
'secret' => env('SQS_SECRET', 'your-secret-key'),
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
||||||
'queue' => env('SQS_QUEUE', 'your-queue-name'),
|
'queue' => env('SQS_QUEUE', 'your-queue-name'),
|
||||||
'region' => env('SQS_REGION', 'us-east-1'),
|
'suffix' => env('SQS_SUFFIX'),
|
||||||
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'redis' => [
|
'redis' => [
|
||||||
|
@ -80,7 +81,7 @@ return [
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'failed' => [
|
'failed' => [
|
||||||
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
|
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
|
||||||
'database' => env('DB_CONNECTION', 'mysql'),
|
'database' => env('DB_CONNECTION', 'mysql'),
|
||||||
'table' => 'failed_jobs',
|
'table' => 'failed_jobs',
|
||||||
],
|
],
|
||||||
|
|
|
@ -8,9 +8,9 @@ return [
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This file is for storing the credentials for third party services such
|
| This file is for storing the credentials for third party services such
|
||||||
| as Stripe, Mailgun, SparkPost and others. This file provides a sane
|
| as Mailgun, Postmark, AWS and more. This file provides the de facto
|
||||||
| default location for this type of information, allowing packages
|
| location for this type of information, allowing packages to have
|
||||||
| to have a conventional place to find your various credentials.
|
| a conventional file to locate the various service credentials.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@ return [
|
||||||
],
|
],
|
||||||
|
|
||||||
'ses' => [
|
'ses' => [
|
||||||
'key' => env('SES_KEY'),
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
'secret' => env('SES_SECRET'),
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
'region' => 'us-east-1',
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -92,9 +92,11 @@ return [
|
||||||
| Session Cache Store
|
| Session Cache Store
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| When using the "apc" or "memcached" session drivers, you may specify a
|
| While using one of the framework's cache driven session backends you may
|
||||||
| cache store that should be used for these sessions. This value must
|
| list a cache store that should be used for these sessions. This value
|
||||||
| correspond with one of the application's configured cache stores.
|
| must match with one of the application's configured cache "stores".
|
||||||
|
|
|
||||||
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -166,7 +168,7 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'secure' => env('SESSION_SECURE_COOKIE', null),
|
'secure' => env('SESSION_SECURE_COOKIE'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -188,12 +190,12 @@ return [
|
||||||
|
|
|
|
||||||
| This option determines how your cookies behave when cross-site requests
|
| This option determines how your cookies behave when cross-site requests
|
||||||
| take place, and can be used to mitigate CSRF attacks. By default, we
|
| take place, and can be used to mitigate CSRF attacks. By default, we
|
||||||
| do not enable this as other CSRF protection services are in place.
|
| will set this value to "lax" since this is a secure default value.
|
||||||
|
|
|
|
||||||
| Supported: "lax", "strict"
|
| Supported: "lax", "strict", "none", null
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'same_site' => null,
|
'same_site' => 'lax',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,12 +1,35 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Bookmark;
|
namespace Database\Factories;
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(Bookmark::class, function (Faker $faker) {
|
use App\Models\Bookmark;
|
||||||
return [
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
'url' => $faker->url,
|
use Illuminate\Support\Carbon;
|
||||||
'name' => $faker->sentence,
|
|
||||||
'content' => $faker->text,
|
class BookmarkFactory extends Factory
|
||||||
];
|
{
|
||||||
});
|
/**
|
||||||
|
* The name of the factory's corresponding model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $model = Bookmark::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
$now = Carbon::now()->subDays(rand(5, 15));
|
||||||
|
|
||||||
|
return [
|
||||||
|
'url' => $this->faker->url,
|
||||||
|
'name' => $this->faker->sentence,
|
||||||
|
'content' => $this->faker->text,
|
||||||
|
'created_at' => $now->toDateTimeString(),
|
||||||
|
'updated_at' => $now->toDateTimeString(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,13 +1,36 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Like;
|
namespace Database\Factories;
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(Like::class, function (Faker $faker) {
|
use App\Models\Like;
|
||||||
return [
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
'url' => $faker->url,
|
use Illuminate\Support\Carbon;
|
||||||
'author_name' => $faker->name,
|
|
||||||
'author_url' => $faker->url,
|
class LikeFactory extends Factory
|
||||||
'content' => '<html><body><div class="h-entry"><div class="e-content">' . $faker->realtext() . '</div></div></body></html>',
|
{
|
||||||
];
|
/**
|
||||||
});
|
* The name of the factory's corresponding model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $model = Like::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
$now = Carbon::now()->subDays(rand(5, 15));
|
||||||
|
|
||||||
|
return [
|
||||||
|
'url' => $this->faker->url,
|
||||||
|
'author_name' => $this->faker->name,
|
||||||
|
'author_url' => $this->faker->url,
|
||||||
|
'content' => '<html><body><div class="h-entry"><div class="e-content">' . $this->faker->realtext() . '</div></div></body></html>',
|
||||||
|
'created_at' => $now->toDateTimeString(),
|
||||||
|
'updated_at' => $now->toDateTimeString(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
29
database/factories/MicropubClientFactory.php
Normal file
29
database/factories/MicropubClientFactory.php
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Models\MicropubClient;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
class MicropubClientFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name of the factory's corresponding model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $model = MicropubClient::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'client_url' => $this->faker->url,
|
||||||
|
'client_name' => $this->faker->company,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,14 +1,33 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
use App\Models\Note;
|
use App\Models\Note;
|
||||||
use Faker\Generator as Faker;
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
$factory->define(Note::class, function (Faker $faker) {
|
class NoteFactory extends Factory
|
||||||
$now = Carbon::now()->subDays(rand(5, 15));
|
{
|
||||||
return [
|
/**
|
||||||
'note' => $faker->paragraph,
|
* The name of the factory's corresponding model.
|
||||||
'created_at' => $now,
|
*
|
||||||
'updated_at' => $now,
|
* @var string
|
||||||
];
|
*/
|
||||||
});
|
protected $model = Note::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
$now = Carbon::now()->subDays(rand(5, 15));
|
||||||
|
|
||||||
|
return [
|
||||||
|
'note' => $this->faker->paragraph,
|
||||||
|
'created_at' => $now,
|
||||||
|
'updated_at' => $now,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
32
database/factories/PlaceFactory.php
Normal file
32
database/factories/PlaceFactory.php
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Models\Place;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
class PlaceFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name of the factory's corresponding model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $model = Place::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => $this->faker->company,
|
||||||
|
'description' => $this->faker->sentence,
|
||||||
|
'latitude' => $this->faker->latitude,
|
||||||
|
'longitude' => $this->faker->longitude,
|
||||||
|
'external_urls' => $this->faker->url,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,28 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Tag;
|
namespace Database\Factories;
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
$factory->define(Tag::class, function (Faker $faker) {
|
use App\Models\Tag;
|
||||||
return [
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
'tag' => $faker->word,
|
|
||||||
];
|
class TagFactory extends Factory
|
||||||
});
|
{
|
||||||
|
/**
|
||||||
|
* The name of the factory's corresponding model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $model = Tag::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'tag' => $this->faker->word,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,24 +1,31 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Faker\Generator as Faker;
|
|
||||||
|
|
||||||
/*
|
class UserFactory extends Factory
|
||||||
|--------------------------------------------------------------------------
|
{
|
||||||
| Model Factories
|
/**
|
||||||
|--------------------------------------------------------------------------
|
* The name of the factory's corresponding model.
|
||||||
|
|
*
|
||||||
| This directory should contain each of the model factory definitions for
|
* @var string
|
||||||
| your application. Factories provide a convenient way to generate new
|
*/
|
||||||
| model instances for testing / seeding your application's database.
|
protected $model = User::class;
|
||||||
|
|
|
||||||
*/
|
|
||||||
$factory->define(App\Models\User::class, function (Faker $faker) {
|
|
||||||
static $password;
|
|
||||||
|
|
||||||
return [
|
/**
|
||||||
'name' => mb_strtolower($faker->firstName),
|
* Define the model's default state.
|
||||||
'password' => $password ?: $password = bcrypt('secret'),
|
*
|
||||||
'remember_token' => Str::random(10),
|
* @return array
|
||||||
];
|
*/
|
||||||
});
|
public function definition()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => $this->faker->name,
|
||||||
|
'password' => bcrypt('password'),
|
||||||
|
'remember_token' => Str::random(10),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\Article;
|
use App\Models\Article;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
21
database/seeders/BookmarksTableSeeder.php
Normal file
21
database/seeders/BookmarksTableSeeder.php
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\{Bookmark, Tag};
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class BookmarksTableSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
Bookmark::factory(10)
|
||||||
|
->has(Tag::factory()->count(1))
|
||||||
|
->create();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\MicropubClient;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class ClientsTableSeeder extends Seeder
|
class ClientsTableSeeder extends Seeder
|
||||||
{
|
{
|
||||||
|
@ -25,5 +29,7 @@ class ClientsTableSeeder extends Seeder
|
||||||
'created_at' => Carbon::now()->toDateTimeString(),
|
'created_at' => Carbon::now()->toDateTimeString(),
|
||||||
'updated_at' => Carbon::now()->toDateTimeString(),
|
'updated_at' => Carbon::now()->toDateTimeString(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
MicropubClient::factory(5)->create();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\Contact;
|
use App\Models\Contact;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Illuminate\FileSystem\FileSystem;
|
use Illuminate\FileSystem\FileSystem;
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
class DatabaseSeeder extends Seeder
|
class DatabaseSeeder extends Seeder
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\Like;
|
use App\Models\Like;
|
||||||
use Faker\Generator;
|
use Faker\Generator;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
@ -15,15 +17,7 @@ class LikesTableSeeder extends Seeder
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
factory(Like::class, 10)->create()->each(function ($like) {
|
Like::factory(10)->create();
|
||||||
$now = Carbon::now()->subDays(rand(5, 15));
|
|
||||||
DB::table('likes')
|
|
||||||
->where('id', $like->id)
|
|
||||||
->update([
|
|
||||||
'created_at' => $now->toDateTimeString(),
|
|
||||||
'updated_at' => $now->toDateTimeString(),
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
$now = Carbon::now()->subDays(rand(3, 6));
|
$now = Carbon::now()->subDays(rand(3, 6));
|
||||||
$faker = new Generator();
|
$faker = new Generator();
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use App\Models\{Media, Note, Place};
|
use App\Models\{Media, Note, Place};
|
||||||
|
use SplFileInfo;
|
||||||
|
|
||||||
class NotesTableSeeder extends Seeder
|
class NotesTableSeeder extends Seeder
|
||||||
{
|
{
|
||||||
|
@ -205,5 +208,7 @@ EOF;
|
||||||
DB::table('notes')
|
DB::table('notes')
|
||||||
->where('id', $noteWithLongUrl->id)
|
->where('id', $noteWithLongUrl->id)
|
||||||
->update(['updated_at' => $now->toDateTimeString()]);
|
->update(['updated_at' => $now->toDateTimeString()]);
|
||||||
|
|
||||||
|
Note::factory(10)->create();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\Place;
|
use App\Models\Place;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
@ -20,5 +22,7 @@ class PlacesTableSeeder extends Seeder
|
||||||
$place->external_urls = 'https://foursquare.com/v/123435/the-bridgewater-pub';
|
$place->external_urls = 'https://foursquare.com/v/123435/the-bridgewater-pub';
|
||||||
$place->external_urls = 'https://www.openstreetmap.org/way/987654';
|
$place->external_urls = 'https://www.openstreetmap.org/way/987654';
|
||||||
$place->save();
|
$place->save();
|
||||||
|
|
||||||
|
Place::factory(10)->create();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\WebMention;
|
use App\Models\WebMention;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
@ -12,7 +14,8 @@ class WebMentionsTableSeeder extends Seeder
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$webmentionAaron = WebMention::create([
|
// WebMention Aaron
|
||||||
|
WebMention::create([
|
||||||
'source' => 'https://aaronpk.localhost/reply/1',
|
'source' => 'https://aaronpk.localhost/reply/1',
|
||||||
'target' => config('app.url') . '/notes/E',
|
'target' => config('app.url') . '/notes/E',
|
||||||
'commentable_id' => '14',
|
'commentable_id' => '14',
|
||||||
|
@ -20,7 +23,8 @@ class WebMentionsTableSeeder extends Seeder
|
||||||
'type' => 'in-reply-to',
|
'type' => 'in-reply-to',
|
||||||
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["https://aaronpk.localhost/reply/1"], "name": ["Hi too"], "author": [{"type": ["h-card"], "value": "Aaron Parecki", "properties": {"url": ["https://aaronpk.localhost"], "name": ["Aaron Parecki"], "photo": ["https://aaronparecki.com/images/profile.jpg"]}}], "content": [{"html": "Hi too", "value": "Hi too"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["https://aaronpk.loclahost/reply/1", "' . config('app.url') .'/notes/E"]}}]}'
|
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["https://aaronpk.localhost/reply/1"], "name": ["Hi too"], "author": [{"type": ["h-card"], "value": "Aaron Parecki", "properties": {"url": ["https://aaronpk.localhost"], "name": ["Aaron Parecki"], "photo": ["https://aaronparecki.com/images/profile.jpg"]}}], "content": [{"html": "Hi too", "value": "Hi too"}], "published": ["' . date(DATE_W3C) . '"], "in-reply-to": ["https://aaronpk.loclahost/reply/1", "' . config('app.url') .'/notes/E"]}}]}'
|
||||||
]);
|
]);
|
||||||
$webmentionTantek = WebMention::create([
|
// WebMention Tantek
|
||||||
|
WebMention::create([
|
||||||
'source' => 'http://tantek.com/',
|
'source' => 'http://tantek.com/',
|
||||||
'target' => config('app.url') . '/notes/D',
|
'target' => config('app.url') . '/notes/D',
|
||||||
'commentable_id' => '13',
|
'commentable_id' => '13',
|
|
@ -1,29 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use App\Models\{Bookmark, Tag};
|
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class BookmarksTableSeeder extends Seeder
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the database seeds.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
factory(Bookmark::class, 10)->create()->each(function ($bookmark) {
|
|
||||||
$bookmark->tags()->save(factory(Tag::class)->make());
|
|
||||||
|
|
||||||
$now = Carbon::now()->subDays(rand(2, 12));
|
|
||||||
DB::table('bookmarks')
|
|
||||||
->where('id', $bookmark->id)
|
|
||||||
->update([
|
|
||||||
'created_at' => $now->toDateTimeString(),
|
|
||||||
'updated_at' => $now->toDateTimeString(),
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,60 +1,55 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
use Illuminate\Contracts\Http\Kernel;
|
||||||
* Laravel - A PHP Framework For Web Artisans
|
use Illuminate\Http\Request;
|
||||||
*
|
|
||||||
* @package Laravel
|
|
||||||
* @author Taylor Otwell <taylor@laravel.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
define('LARAVEL_START', microtime(true));
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Check If Application Is Under Maintenance
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| If the application is maintenance / demo mode via the "down" command we
|
||||||
|
| will require this file so that any prerendered template can be shown
|
||||||
|
| instead of starting the framework, which could cause an exception.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (file_exists(__DIR__ . '/../storage/framework/maintenance.php')) {
|
||||||
|
require __DIR__ . '/../storage/framework/maintenance.php';
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Register The Auto Loader
|
| Register The Auto Loader
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Composer provides a convenient, automatically generated class loader for
|
| Composer provides a convenient, automatically generated class loader for
|
||||||
| our application. We just need to utilize it! We'll simply require it
|
| this application. We just need to utilize it! We'll simply require it
|
||||||
| into the script here so that we don't have to worry about manual
|
| into the script here so we don't need to manually load our classes.
|
||||||
| loading any of our classes later on. It feels great to relax.
|
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require __DIR__.'/../vendor/autoload.php';
|
require __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Turn On The Lights
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| We need to illuminate PHP development, so let us turn on the lights.
|
|
||||||
| This bootstraps the framework and gets it ready for use, then it
|
|
||||||
| will load up this application so that we can run it and send
|
|
||||||
| the responses back to the browser and delight our users.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
$app = require_once __DIR__.'/../bootstrap/app.php';
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Run The Application
|
| Run The Application
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Once we have the application, we can handle the incoming request
|
| Once we have the application, we can handle the incoming request using
|
||||||
| through the kernel, and send the associated response back to
|
| the application's HTTP kernel. Then, we will send the response back
|
||||||
| the client's browser allowing them to enjoy the creative
|
| to this client's browser, allowing them to enjoy our application.
|
||||||
| and wonderful application we have prepared for them.
|
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
|
$app = require_once __DIR__ . '/../bootstrap/app.php';
|
||||||
|
|
||||||
$response = $kernel->handle(
|
$kernel = $app->make(Kernel::class);
|
||||||
$request = Illuminate\Http\Request::capture()
|
|
||||||
);
|
|
||||||
|
|
||||||
$response->send();
|
$response = tap($kernel->handle(
|
||||||
|
$request = Request::capture()
|
||||||
|
))->send();
|
||||||
|
|
||||||
$kernel->terminate($request, $response);
|
$kernel->terminate($request, $response);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Broadcast;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Broadcast Channels
|
| Broadcast Channels
|
||||||
|
@ -11,6 +13,6 @@
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Broadcast::channel('App.User.{id}', function ($user, $id) {
|
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||||
return (int) $user->id === (int) $id;
|
return (int) $user->id === (int) $id;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Foundation\Inspiring;
|
use Illuminate\Foundation\Inspiring;
|
||||||
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
189
routes/web.php
189
routes/web.php
|
@ -11,10 +11,32 @@
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use App\Http\Controllers\Admin\ArticlesController as AdminArticlesController;
|
||||||
|
use App\Http\Controllers\Admin\ClientsController;
|
||||||
|
use App\Http\Controllers\Admin\ContactsController as AdminContactsController;
|
||||||
|
use App\Http\Controllers\Admin\HomeController;
|
||||||
|
use App\Http\Controllers\Admin\LikesController as AdminLikesController;
|
||||||
|
use App\Http\Controllers\Admin\NotesController as AdminNotesController;
|
||||||
|
use App\Http\Controllers\Admin\PlacesController as AdminPlacesController;
|
||||||
|
use App\Http\Controllers\ArticlesController;
|
||||||
|
use App\Http\Controllers\AuthController;
|
||||||
|
use App\Http\Controllers\BookmarksController;
|
||||||
|
use App\Http\Controllers\ContactsController;
|
||||||
|
use App\Http\Controllers\FeedsController;
|
||||||
|
use App\Http\Controllers\FrontPageController;
|
||||||
|
use App\Http\Controllers\LikesController;
|
||||||
|
use App\Http\Controllers\MicropubController;
|
||||||
|
use App\Http\Controllers\MicropubMediaController;
|
||||||
|
use App\Http\Controllers\NotesController;
|
||||||
|
use App\Http\Controllers\PlacesController;
|
||||||
|
use App\Http\Controllers\SearchController;
|
||||||
|
use App\Http\Controllers\ShortURLsController;
|
||||||
|
use App\Http\Controllers\TokenEndpointController;
|
||||||
|
use App\Http\Controllers\WebMentionsController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
Route::group(['domain' => config('url.longurl')], function () {
|
Route::group(['domain' => config('url.longurl')], function () {
|
||||||
Route::get('/', 'FrontPageController@index');
|
Route::get('/', [FrontPageController::class, 'index']);
|
||||||
|
|
||||||
// Static project page
|
// Static project page
|
||||||
Route::view('projects', 'projects');
|
Route::view('projects', 'projects');
|
||||||
|
@ -23,12 +45,12 @@ Route::group(['domain' => config('url.longurl')], function () {
|
||||||
Route::view('colophon', 'colophon');
|
Route::view('colophon', 'colophon');
|
||||||
|
|
||||||
// The login routes to get auth’d for admin
|
// The login routes to get auth’d for admin
|
||||||
Route::get('login', 'AuthController@showLogin')->name('login');
|
Route::get('login', [AuthController::class, 'showLogin'])->name('login');
|
||||||
Route::post('login', 'AuthController@login');
|
Route::post('login', [AuthController::class, 'login']);
|
||||||
|
|
||||||
// And the logout routes
|
// And the logout routes
|
||||||
Route::get('logout', 'AuthController@showLogout')->name('logout');
|
Route::get('logout', [AuthController::class, 'showLogout'])->name('logout');
|
||||||
Route::post('logout', 'AuthController@logout');
|
Route::post('logout', [AuthController::class, 'logout']);
|
||||||
|
|
||||||
// Admin pages grouped for filter
|
// Admin pages grouped for filter
|
||||||
Route::group([
|
Route::group([
|
||||||
|
@ -36,149 +58,146 @@ Route::group(['domain' => config('url.longurl')], function () {
|
||||||
'namespace' => 'Admin',
|
'namespace' => 'Admin',
|
||||||
'prefix' => 'admin',
|
'prefix' => 'admin',
|
||||||
], function () {
|
], function () {
|
||||||
Route::get('/', 'HomeController@welcome');
|
Route::get('/', [HomeController::class, 'welcome']);
|
||||||
|
|
||||||
//Articles
|
//Articles
|
||||||
Route::group(['prefix' => 'blog'], function () {
|
Route::group(['prefix' => 'blog'], function () {
|
||||||
Route::get('/', 'ArticlesController@index');
|
Route::get('/', [AdminArticlesController::class, 'index']);
|
||||||
Route::get('/create', 'ArticlesController@create');
|
Route::get('/create', [AdminArticlesController::class, 'create']);
|
||||||
Route::post('/', 'ArticlesController@store');
|
Route::post('/', [AdminArticlesController::class, 'store']);
|
||||||
Route::get('/{id}/edit', 'ArticlesController@edit');
|
Route::get('/{id}/edit', [AdminArticlesController::class, 'edit']);
|
||||||
Route::put('/{id}', 'ArticlesController@update');
|
Route::put('/{id}', [AdminArticlesController::class, 'update']);
|
||||||
Route::delete('/{id}', 'ArticlesController@destroy');
|
Route::delete('/{id}', [AdminArticlesController::class, 'destroy']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Notes
|
// Notes
|
||||||
Route::group(['prefix' => 'notes'], function () {
|
Route::group(['prefix' => 'notes'], function () {
|
||||||
Route::get('/', 'NotesController@index');
|
Route::get('/', [AdminNotesController::class, 'index']);
|
||||||
Route::get('/create', 'NotesController@create');
|
Route::get('/create', [AdminNotesController::class, 'create']);
|
||||||
Route::post('/', 'NotesController@store');
|
Route::post('/', [AdminNotesController::class, 'store']);
|
||||||
Route::get('/{id}/edit', 'NotesController@edit');
|
Route::get('/{id}/edit', [AdminNotesController::class, 'edit']);
|
||||||
Route::put('/{id}', 'NotesController@update');
|
Route::put('/{id}', [AdminNotesController::class, 'update']);
|
||||||
Route::delete('/{id}', 'NotesController@destroy');
|
Route::delete('/{id}', [AdminNotesController::class, 'destroy']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Micropub Clients
|
// Micropub Clients
|
||||||
Route::group(['prefix' => 'clients'], function () {
|
Route::group(['prefix' => 'clients'], function () {
|
||||||
Route::get('/', 'ClientsController@index');
|
Route::get('/', [ClientsController::class, 'index']);
|
||||||
Route::get('/create', 'ClientsController@create');
|
Route::get('/create', [ClientsController::class, 'create']);
|
||||||
Route::post('/', 'ClientsController@store');
|
Route::post('/', [ClientsController::class, 'store']);
|
||||||
Route::get('/{id}/edit', 'ClientsController@edit');
|
Route::get('/{id}/edit', [ClientsController::class, 'edit']);
|
||||||
Route::put('/{id}', 'ClientsController@update');
|
Route::put('/{id}', [ClientsController::class, 'update']);
|
||||||
Route::delete('/{id}', 'ClientsController@destroy');
|
Route::delete('/{id}', [ClientsController::class, 'destroy']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Contacts
|
// Contacts
|
||||||
Route::group(['prefix' => 'contacts'], function () {
|
Route::group(['prefix' => 'contacts'], function () {
|
||||||
Route::get('/', 'ContactsController@index');
|
Route::get('/', [AdminContactsController::class, 'index']);
|
||||||
Route::get('/create', 'ContactsController@create');
|
Route::get('/create', [AdminContactsController::class, 'create']);
|
||||||
Route::post('/', 'ContactsController@store');
|
Route::post('/', [AdminContactsController::class, 'store']);
|
||||||
Route::get('/{id}/edit', 'ContactsController@edit');
|
Route::get('/{id}/edit', [AdminContactsController::class, 'edit']);
|
||||||
Route::put('/{id}', 'ContactsController@update');
|
Route::put('/{id}', [AdminContactsController::class, 'update']);
|
||||||
Route::delete('/{id}', 'ContactsController@destroy');
|
Route::delete('/{id}', [AdminContactsController::class, 'destroy']);
|
||||||
Route::get('/{id}/getavatar', 'ContactsController@getAvatar');
|
Route::get('/{id}/getavatar', [AdminContactsController::class, 'getAvatar']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Places
|
// Places
|
||||||
Route::group(['prefix' => 'places'], function () {
|
Route::group(['prefix' => 'places'], function () {
|
||||||
Route::get('/', 'PlacesController@index');
|
Route::get('/', [AdminPlacesController::class, 'index']);
|
||||||
Route::get('/create', 'PlacesController@create');
|
Route::get('/create', [AdminPlacesController::class, 'create']);
|
||||||
Route::post('/', 'PlacesController@store');
|
Route::post('/', [AdminPlacesController::class, 'store']);
|
||||||
Route::get('/{id}/edit', 'PlacesController@edit');
|
Route::get('/{id}/edit', [AdminPlacesController::class, 'edit']);
|
||||||
Route::put('/{id}', 'PlacesController@update');
|
Route::put('/{id}', [AdminPlacesController::class, 'update']);
|
||||||
Route::get('/{id}/merge', 'PlacesController@mergeIndex');
|
Route::get('/{id}/merge', [AdminPlacesController::class, 'mergeIndex']);
|
||||||
Route::get('/{place1_id}/merge/{place2_id}', 'PlacesController@mergeEdit');
|
Route::get('/{place1_id}/merge/{place2_id}', [AdminPlacesController::class, 'mergeEdit']);
|
||||||
Route::post('/merge', 'PlacesController@mergeStore');
|
Route::post('/merge', [AdminPlacesController::class, 'mergeStore']);
|
||||||
Route::delete('/{id}', 'PlacesController@destroy');
|
Route::delete('/{id}', [AdminPlacesController::class, 'destroy']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Likes
|
// Likes
|
||||||
Route::group(['prefix' => 'likes'], function () {
|
Route::group(['prefix' => 'likes'], function () {
|
||||||
Route::get('/', 'LikesController@index');
|
Route::get('/', [AdminLikesController::class, 'index']);
|
||||||
Route::get('/create', 'LikesController@create');
|
Route::get('/create', [AdminLikesController::class, 'create']);
|
||||||
Route::post('/', 'LikesController@store');
|
Route::post('/', [AdminLikesController::class, 'store']);
|
||||||
Route::get('/{id}/edit', 'LikesController@edit');
|
Route::get('/{id}/edit', [AdminLikesController::class, 'edit']);
|
||||||
Route::put('/{id}', 'LikesController@update');
|
Route::put('/{id}', [AdminLikesController::class, 'update']);
|
||||||
Route::delete('/{id}', 'LikesController@destroy');
|
Route::delete('/{id}', [AdminLikesController::class, 'destroy']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Blog pages using ArticlesController
|
// Blog pages using ArticlesController
|
||||||
Route::group(['prefix' => 'blog'], function () {
|
Route::group(['prefix' => 'blog'], function () {
|
||||||
Route::get('/feed.rss', 'FeedsController@blogRss');
|
Route::get('/feed.rss', [FeedsController::class, 'blogRss']);
|
||||||
Route::get('/feed.atom', 'FeedsController@blogAtom');
|
Route::get('/feed.atom', [FeedsController::class, 'blogAtom']);
|
||||||
Route::get('/feed.json', 'FeedsController@blogJson');
|
Route::get('/feed.json', [FeedsController::class, 'blogJson']);
|
||||||
Route::get('/feed.jf2', 'Feedscontroller@blogJf2');
|
Route::get('/feed.jf2', [Feedscontroller::class, 'blogJf2']);
|
||||||
Route::get('/s/{id}', 'ArticlesController@onlyIdInURL');
|
Route::get('/s/{id}', [ArticlesController::class, 'onlyIdInURL']);
|
||||||
Route::get('/{year?}/{month?}', 'ArticlesController@index');
|
Route::get('/{year?}/{month?}', [ArticlesController::class, 'index']);
|
||||||
Route::get('/{year}/{month}/{slug}', 'ArticlesController@show');
|
Route::get('/{year}/{month}/{slug}', [ArticlesController::class, 'show']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Notes pages using NotesController
|
// Notes pages using NotesController
|
||||||
Route::group(['prefix' => 'notes'], function () {
|
Route::group(['prefix' => 'notes'], function () {
|
||||||
Route::get('/', 'NotesController@index');
|
Route::get('/', [NotesController::class, 'index']);
|
||||||
Route::get('/feed.rss', 'FeedsController@notesRss');
|
Route::get('/feed.rss', [FeedsController::class, 'notesRss']);
|
||||||
Route::get('/feed.atom', 'FeedsController@notesAtom');
|
Route::get('/feed.atom', [FeedsController::class, 'notesAtom']);
|
||||||
Route::get('/feed.json', 'FeedsController@notesJson');
|
Route::get('/feed.json', [FeedsController::class, 'notesJson']);
|
||||||
Route::get('/feed.jf2', 'FeedsController@notesJf2');
|
Route::get('/feed.jf2', [FeedsController::class, 'notesJf2']);
|
||||||
Route::get('/{id}', 'NotesController@show');
|
Route::get('/{id}', [NotesController::class, 'show']);
|
||||||
Route::get('/tagged/{tag}', 'NotesController@tagged');
|
Route::get('/tagged/{tag}', [NotesController::class, 'tagged']);
|
||||||
});
|
});
|
||||||
Route::get('note/{id}', 'NotesController@redirect'); // for legacy note URLs
|
Route::get('note/{id}', [NotesController::class, 'redirect']); // for legacy note URLs
|
||||||
|
|
||||||
// Likes
|
// Likes
|
||||||
Route::group(['prefix' => 'likes'], function () {
|
Route::group(['prefix' => 'likes'], function () {
|
||||||
Route::get('/', 'LikesController@index');
|
Route::get('/', [LikesController::class, 'index']);
|
||||||
Route::get('/{like}', 'LikesController@show');
|
Route::get('/{like}', [LikesController::class, 'show']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Bookmarks
|
// Bookmarks
|
||||||
Route::group(['prefix' => 'bookmarks'], function () {
|
Route::group(['prefix' => 'bookmarks'], function () {
|
||||||
Route::get('/', 'BookmarksController@index');
|
Route::get('/', [BookmarksController::class, 'index']);
|
||||||
Route::get('/{bookmark}', 'BookmarksController@show');
|
Route::get('/{bookmark}', [BookmarksController::class, 'show']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Token Endpoint
|
// Token Endpoint
|
||||||
Route::post('api/token', 'TokenEndpointController@create');
|
Route::post('api/token', [TokenEndpointController::class, 'create']);
|
||||||
|
|
||||||
// Micropub Endpoints
|
// Micropub Endpoints
|
||||||
Route::get('api/post', 'MicropubController@get')->middleware('micropub.token');
|
Route::get('api/post', [MicropubController::class, 'get'])->middleware('micropub.token');
|
||||||
Route::post('api/post', 'MicropubController@post')->middleware('micropub.token');
|
Route::post('api/post', [MicropubController::class, 'post'])->middleware('micropub.token');
|
||||||
Route::get('api/media', 'MicropubMediaController@getHandler')->middleware('micropub.token');
|
Route::get('api/media', [MicropubMediaController::class, 'getHandler'])->middleware('micropub.token');
|
||||||
Route::post('api/media', 'MicropubMediaController@media')
|
Route::post('api/media', [MicropubMediaController:: class, 'media'])
|
||||||
->middleware('micropub.token', 'cors')
|
->middleware('micropub.token', 'cors')
|
||||||
->name('media-endpoint');
|
->name('media-endpoint');
|
||||||
Route::options('/api/media', 'MicropubMediaController@mediaOptionsResponse')->middleware('cors');
|
Route::options('/api/media', [MicropubMediaController::class, 'mediaOptionsResponse'])->middleware('cors');
|
||||||
|
|
||||||
// Webmention
|
// Webmention
|
||||||
Route::get('webmention', 'WebMentionsController@get');
|
Route::get('webmention', [WebMentionsController::class, 'get']);
|
||||||
Route::post('webmention', 'WebMentionsController@receive');
|
Route::post('webmention', [WebMentionsController::class, 'receive']);
|
||||||
|
|
||||||
// Contacts
|
// Contacts
|
||||||
Route::get('contacts', 'ContactsController@index');
|
Route::get('contacts', [ContactsController::class, 'index']);
|
||||||
Route::get('contacts/{contact:nick}', 'ContactsController@show');
|
Route::get('contacts/{contact:nick}', [ContactsController::class, 'show']);
|
||||||
|
|
||||||
// Places
|
// Places
|
||||||
Route::get('places', 'PlacesController@index');
|
Route::get('places', [PlacesController::class, 'index']);
|
||||||
Route::get('places/{place}', 'PlacesController@show');
|
Route::get('places/{place}', [PlacesController::class, 'show']);
|
||||||
|
|
||||||
Route::get('search', 'SearchController@search');
|
Route::get('search', [SearchController::class, 'search']);
|
||||||
|
|
||||||
Route::post('update-colour-scheme', 'SessionStoreController@saveColour');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Short URL
|
// Short URL
|
||||||
Route::group(['domain' => config('url.shorturl')], function () {
|
Route::group(['domain' => config('url.shorturl')], function () {
|
||||||
Route::get('/', 'ShortURLsController@baseURL');
|
Route::get('/', [ShortURLsController::class, 'baseURL']);
|
||||||
Route::get('@', 'ShortURLsController@twitter');
|
Route::get('@', [ShortURLsController::class, 'twitter']);
|
||||||
Route::get('+', 'ShortURLsController@googlePlus');
|
|
||||||
|
|
||||||
Route::get('{type}/{id}', 'ShortURLsController@expandType')->where(
|
Route::get('{type}/{id}', [ShortURLsController::class, 'expandType'])->where(
|
||||||
[
|
[
|
||||||
'type' => '[bt]',
|
'type' => '[bt]',
|
||||||
'id' => '[0-9A-HJ-NP-Z_a-km-z]+',
|
'id' => '[0-9A-HJ-NP-Z_a-km-z]+',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
Route::get('h/{id}', 'ShortURLsController@redirect');
|
Route::get('h/{id}', [ShortURLsController::class, 'redirect']);
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@ class AdminHomeControllerTest extends TestCase
|
||||||
|
|
||||||
public function test_admin_homepage()
|
public function test_admin_homepage()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)
|
$response = $this->actingAs($user)
|
||||||
->get('/admin');
|
->get('/admin');
|
||||||
|
|
|
@ -13,7 +13,7 @@ class ArticlesTest extends TestCase
|
||||||
|
|
||||||
public function test_index_page()
|
public function test_index_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)
|
$response = $this->actingAs($user)
|
||||||
->get('/admin/blog');
|
->get('/admin/blog');
|
||||||
|
@ -22,7 +22,7 @@ class ArticlesTest extends TestCase
|
||||||
|
|
||||||
public function test_create_page()
|
public function test_create_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)
|
$response = $this->actingAs($user)
|
||||||
->get('/admin/blog/create');
|
->get('/admin/blog/create');
|
||||||
|
@ -31,7 +31,7 @@ class ArticlesTest extends TestCase
|
||||||
|
|
||||||
public function test_create_new_article()
|
public function test_create_new_article()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/blog', [
|
->post('/admin/blog', [
|
||||||
|
@ -43,7 +43,7 @@ class ArticlesTest extends TestCase
|
||||||
|
|
||||||
public function test_create_new_article_with_upload()
|
public function test_create_new_article_with_upload()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
$faker = \Faker\Factory::create();
|
$faker = \Faker\Factory::create();
|
||||||
$text = $faker->text;
|
$text = $faker->text;
|
||||||
if ($fh = fopen(sys_get_temp_dir() . '/article.md', 'w')) {
|
if ($fh = fopen(sys_get_temp_dir() . '/article.md', 'w')) {
|
||||||
|
@ -67,7 +67,7 @@ class ArticlesTest extends TestCase
|
||||||
|
|
||||||
public function test_see_edit_form()
|
public function test_see_edit_form()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)
|
$response = $this->actingAs($user)
|
||||||
->get('/admin/blog/1/edit');
|
->get('/admin/blog/1/edit');
|
||||||
|
@ -76,7 +76,7 @@ class ArticlesTest extends TestCase
|
||||||
|
|
||||||
public function test_edit_article()
|
public function test_edit_article()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/blog/1', [
|
->post('/admin/blog/1', [
|
||||||
|
@ -92,7 +92,7 @@ class ArticlesTest extends TestCase
|
||||||
|
|
||||||
public function test_delete_article()
|
public function test_delete_article()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/blog/1', [
|
->post('/admin/blog/1', [
|
||||||
|
|
|
@ -12,7 +12,7 @@ class ClientsTest extends TestCase
|
||||||
|
|
||||||
public function test_index_page()
|
public function test_index_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)
|
$response = $this->actingAs($user)
|
||||||
->get('/admin/clients');
|
->get('/admin/clients');
|
||||||
|
@ -21,7 +21,7 @@ class ClientsTest extends TestCase
|
||||||
|
|
||||||
public function test_create_page()
|
public function test_create_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)
|
$response = $this->actingAs($user)
|
||||||
->get('/admin/clients/create');
|
->get('/admin/clients/create');
|
||||||
|
@ -30,7 +30,7 @@ class ClientsTest extends TestCase
|
||||||
|
|
||||||
public function test_create_new_client()
|
public function test_create_new_client()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/clients', [
|
->post('/admin/clients', [
|
||||||
|
@ -45,7 +45,7 @@ class ClientsTest extends TestCase
|
||||||
|
|
||||||
public function test_see_edit_form()
|
public function test_see_edit_form()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)
|
$response = $this->actingAs($user)
|
||||||
->get('/admin/clients/1/edit');
|
->get('/admin/clients/1/edit');
|
||||||
|
@ -54,7 +54,7 @@ class ClientsTest extends TestCase
|
||||||
|
|
||||||
public function test_edit_client()
|
public function test_edit_client()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/clients/1', [
|
->post('/admin/clients/1', [
|
||||||
|
@ -70,7 +70,7 @@ class ClientsTest extends TestCase
|
||||||
|
|
||||||
public function test_delete_client()
|
public function test_delete_client()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/clients/1', [
|
->post('/admin/clients/1', [
|
||||||
|
|
|
@ -27,7 +27,7 @@ class ContactsTest extends TestCase
|
||||||
|
|
||||||
public function test_index_page()
|
public function test_index_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/contacts');
|
$response = $this->actingAs($user)->get('/admin/contacts');
|
||||||
$response->assertViewIs('admin.contacts.index');
|
$response->assertViewIs('admin.contacts.index');
|
||||||
|
@ -35,7 +35,7 @@ class ContactsTest extends TestCase
|
||||||
|
|
||||||
public function test_create_page()
|
public function test_create_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/contacts/create');
|
$response = $this->actingAs($user)->get('/admin/contacts/create');
|
||||||
$response->assertViewIs('admin.contacts.create');
|
$response->assertViewIs('admin.contacts.create');
|
||||||
|
@ -43,7 +43,7 @@ class ContactsTest extends TestCase
|
||||||
|
|
||||||
public function test_create_new_contact()
|
public function test_create_new_contact()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)->post('/admin/contacts', [
|
$this->actingAs($user)->post('/admin/contacts', [
|
||||||
'name' => 'Fred Bloggs',
|
'name' => 'Fred Bloggs',
|
||||||
|
@ -59,7 +59,7 @@ class ContactsTest extends TestCase
|
||||||
|
|
||||||
public function test_see_edit_form()
|
public function test_see_edit_form()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/contacts/1/edit');
|
$response = $this->actingAs($user)->get('/admin/contacts/1/edit');
|
||||||
$response->assertViewIs('admin.contacts.edit');
|
$response->assertViewIs('admin.contacts.edit');
|
||||||
|
@ -67,7 +67,7 @@ class ContactsTest extends TestCase
|
||||||
|
|
||||||
public function test_update_contact_no_uploaded_avatar()
|
public function test_update_contact_no_uploaded_avatar()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)->post('/admin/contacts/1', [
|
$this->actingAs($user)->post('/admin/contacts/1', [
|
||||||
'_method' => 'PUT',
|
'_method' => 'PUT',
|
||||||
|
@ -87,7 +87,7 @@ class ContactsTest extends TestCase
|
||||||
copy(__DIR__ . '/../../aaron.png', sys_get_temp_dir() . '/tantek.png');
|
copy(__DIR__ . '/../../aaron.png', sys_get_temp_dir() . '/tantek.png');
|
||||||
$path = sys_get_temp_dir() . '/tantek.png';
|
$path = sys_get_temp_dir() . '/tantek.png';
|
||||||
$file = new UploadedFile($path, 'tantek.png', 'image/png', null, true);
|
$file = new UploadedFile($path, 'tantek.png', 'image/png', null, true);
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)->post('/admin/contacts/1', [
|
$this->actingAs($user)->post('/admin/contacts/1', [
|
||||||
'_method' => 'PUT',
|
'_method' => 'PUT',
|
||||||
|
@ -105,7 +105,7 @@ class ContactsTest extends TestCase
|
||||||
|
|
||||||
public function test_delete_contact()
|
public function test_delete_contact()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)->post('/admin/contacts/1', [
|
$this->actingAs($user)->post('/admin/contacts/1', [
|
||||||
'_method' => 'DELETE',
|
'_method' => 'DELETE',
|
||||||
|
@ -130,7 +130,7 @@ HTML;
|
||||||
$handler = HandlerStack::create($mock);
|
$handler = HandlerStack::create($mock);
|
||||||
$client = new Client(['handler' => $handler]);
|
$client = new Client(['handler' => $handler]);
|
||||||
$this->app->instance(Client::class, $client);
|
$this->app->instance(Client::class, $client);
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)->get('/admin/contacts/1/getavatar');
|
$this->actingAs($user)->get('/admin/contacts/1/getavatar');
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ HTML;
|
||||||
$handler = HandlerStack::create($mock);
|
$handler = HandlerStack::create($mock);
|
||||||
$client = new Client(['handler' => $handler]);
|
$client = new Client(['handler' => $handler]);
|
||||||
$this->app->instance(Client::class, $client);
|
$this->app->instance(Client::class, $client);
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/contacts/1/getavatar');
|
$response = $this->actingAs($user)->get('/admin/contacts/1/getavatar');
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ HTML;
|
||||||
$handler = HandlerStack::create($mock);
|
$handler = HandlerStack::create($mock);
|
||||||
$client = new Client(['handler' => $handler]);
|
$client = new Client(['handler' => $handler]);
|
||||||
$this->app->instance(Client::class, $client);
|
$this->app->instance(Client::class, $client);
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/contacts/1/getavatar');
|
$response = $this->actingAs($user)->get('/admin/contacts/1/getavatar');
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ HTML;
|
||||||
'nick' => 'fred',
|
'nick' => 'fred',
|
||||||
'name' => 'Fred Bloggs',
|
'name' => 'Fred Bloggs',
|
||||||
]);
|
]);
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/contacts/' . $contact->id . '/getavatar');
|
$response = $this->actingAs($user)->get('/admin/contacts/' . $contact->id . '/getavatar');
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ class LikesTest extends TestCase
|
||||||
|
|
||||||
public function test_index_page()
|
public function test_index_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)
|
$response = $this->actingAs($user)
|
||||||
->get('/admin/likes');
|
->get('/admin/likes');
|
||||||
|
@ -24,7 +24,7 @@ class LikesTest extends TestCase
|
||||||
|
|
||||||
public function test_create_page()
|
public function test_create_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)
|
$response = $this->actingAs($user)
|
||||||
->get('/admin/likes/create');
|
->get('/admin/likes/create');
|
||||||
|
@ -34,7 +34,7 @@ class LikesTest extends TestCase
|
||||||
public function test_create_new_like()
|
public function test_create_new_like()
|
||||||
{
|
{
|
||||||
Queue::fake();
|
Queue::fake();
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/likes', [
|
->post('/admin/likes', [
|
||||||
|
@ -48,7 +48,7 @@ class LikesTest extends TestCase
|
||||||
|
|
||||||
public function test_see_edit_form()
|
public function test_see_edit_form()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)
|
$response = $this->actingAs($user)
|
||||||
->get('/admin/likes/1/edit');
|
->get('/admin/likes/1/edit');
|
||||||
|
@ -58,7 +58,7 @@ class LikesTest extends TestCase
|
||||||
public function test_edit_like()
|
public function test_edit_like()
|
||||||
{
|
{
|
||||||
Queue::fake();
|
Queue::fake();
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/likes/1', [
|
->post('/admin/likes/1', [
|
||||||
|
@ -75,7 +75,7 @@ class LikesTest extends TestCase
|
||||||
{
|
{
|
||||||
$like = Like::find(1);
|
$like = Like::find(1);
|
||||||
$url = $like->url;
|
$url = $like->url;
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)
|
$this->actingAs($user)
|
||||||
->post('/admin/likes/1', [
|
->post('/admin/likes/1', [
|
||||||
|
|
|
@ -14,7 +14,7 @@ class NotesTest extends TestCase
|
||||||
|
|
||||||
public function test_index_page()
|
public function test_index_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/notes');
|
$response = $this->actingAs($user)->get('/admin/notes');
|
||||||
$response->assertViewIs('admin.notes.index');
|
$response->assertViewIs('admin.notes.index');
|
||||||
|
@ -22,7 +22,7 @@ class NotesTest extends TestCase
|
||||||
|
|
||||||
public function test_create_page()
|
public function test_create_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/notes/create');
|
$response = $this->actingAs($user)->get('/admin/notes/create');
|
||||||
$response->assertViewIs('admin.notes.create');
|
$response->assertViewIs('admin.notes.create');
|
||||||
|
@ -30,7 +30,7 @@ class NotesTest extends TestCase
|
||||||
|
|
||||||
public function test_create_a_new_note()
|
public function test_create_a_new_note()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)->post('/admin/notes', [
|
$this->actingAs($user)->post('/admin/notes', [
|
||||||
'content' => 'A new test note',
|
'content' => 'A new test note',
|
||||||
|
@ -42,7 +42,7 @@ class NotesTest extends TestCase
|
||||||
|
|
||||||
public function test_edit_page()
|
public function test_edit_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/notes/1/edit');
|
$response = $this->actingAs($user)->get('/admin/notes/1/edit');
|
||||||
$response->assertViewIs('admin.notes.edit');
|
$response->assertViewIs('admin.notes.edit');
|
||||||
|
@ -51,7 +51,7 @@ class NotesTest extends TestCase
|
||||||
public function test_edit_a_note()
|
public function test_edit_a_note()
|
||||||
{
|
{
|
||||||
Queue::fake();
|
Queue::fake();
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)->post('/admin/notes/1', [
|
$this->actingAs($user)->post('/admin/notes/1', [
|
||||||
'_method' => 'PUT',
|
'_method' => 'PUT',
|
||||||
|
@ -67,7 +67,7 @@ class NotesTest extends TestCase
|
||||||
|
|
||||||
public function test_delete_note()
|
public function test_delete_note()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)->post('/admin/notes/1', [
|
$this->actingAs($user)->post('/admin/notes/1', [
|
||||||
'_method' => 'DELETE',
|
'_method' => 'DELETE',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class PlacesTest extends TestCase
|
||||||
|
|
||||||
public function test_index_page()
|
public function test_index_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/places');
|
$response = $this->actingAs($user)->get('/admin/places');
|
||||||
$response->assertViewIs('admin.places.index');
|
$response->assertViewIs('admin.places.index');
|
||||||
|
@ -20,7 +20,7 @@ class PlacesTest extends TestCase
|
||||||
|
|
||||||
public function test_create_page()
|
public function test_create_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/places/create');
|
$response = $this->actingAs($user)->get('/admin/places/create');
|
||||||
$response->assertViewIs('admin.places.create');
|
$response->assertViewIs('admin.places.create');
|
||||||
|
@ -28,7 +28,7 @@ class PlacesTest extends TestCase
|
||||||
|
|
||||||
public function test_create_new_place()
|
public function test_create_new_place()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)->post('/admin/places', [
|
$this->actingAs($user)->post('/admin/places', [
|
||||||
'name' => 'Test Place',
|
'name' => 'Test Place',
|
||||||
|
@ -44,7 +44,7 @@ class PlacesTest extends TestCase
|
||||||
|
|
||||||
public function test_edit_page()
|
public function test_edit_page()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$response = $this->actingAs($user)->get('/admin/places/1/edit');
|
$response = $this->actingAs($user)->get('/admin/places/1/edit');
|
||||||
$response->assertViewIs('admin.places.edit');
|
$response->assertViewIs('admin.places.edit');
|
||||||
|
@ -52,7 +52,7 @@ class PlacesTest extends TestCase
|
||||||
|
|
||||||
public function test_updating_a_place()
|
public function test_updating_a_place()
|
||||||
{
|
{
|
||||||
$user = factory(User::class)->create();
|
$user = User::factory()->make();
|
||||||
|
|
||||||
$this->actingAs($user)->post('/admin/places/1', [
|
$this->actingAs($user)->post('/admin/places/1', [
|
||||||
'_method' => 'PUT',
|
'_method' => 'PUT',
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Feature;
|
|
||||||
|
|
||||||
use Tests\TestCase;
|
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
||||||
|
|
||||||
class SessionStoreControllerTest extends TestCase
|
|
||||||
{
|
|
||||||
public function test_colour_preference_saved()
|
|
||||||
{
|
|
||||||
$response = $this->post('update-colour-scheme', ['css' => 'some.css']);
|
|
||||||
$response->assertJson(['status' => 'ok']);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -19,12 +19,6 @@ class ShortURLsControllerTest extends TestCase
|
||||||
$response->assertRedirect('https://twitter.com/jonnybarnes');
|
$response->assertRedirect('https://twitter.com/jonnybarnes');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_short_domain_slashplus_redirects_to_googleplus()
|
|
||||||
{
|
|
||||||
$response = $this->get('http://' . config('app.shorturl') . '/+');
|
|
||||||
$response->assertRedirect('https://plus.google.com/u/0/117317270900655269082/about');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function test_short_domain_slasht_redirects_to_long_domain_slash_notes()
|
public function test_short_domain_slasht_redirects_to_long_domain_slash_notes()
|
||||||
{
|
{
|
||||||
$response = $this->get('http://' . config('app.shorturl') . '/t/E');
|
$response = $this->get('http://' . config('app.shorturl') . '/t/E');
|
||||||
|
|
|
@ -64,7 +64,7 @@ class PlacesTest extends TestCase
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
$this->assertInstanceOf('App\Models\Place', $ret); // a place was returned
|
$this->assertInstanceOf('App\Models\Place', $ret); // a place was returned
|
||||||
$this->assertEquals(2, count(Place::all())); // still 2 places
|
$this->assertEquals(12, count(Place::all())); // still 2 places
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_service_requires_name()
|
public function test_service_requires_name()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue