Fix model binding when using cached routes, install imagick in container

This commit is contained in:
Adam Lavin 2021-03-29 02:40:59 +01:00
parent 860edbf533
commit 293fd535c4
No known key found for this signature in database
GPG key ID: 9C4C68AFA9CA6461
2 changed files with 8 additions and 6 deletions

View file

@ -42,7 +42,7 @@ COPY --from=atomicparsley_builder /tmp/atomicparsley/AtomicParsley /usr/local/bi
## Common libraries required for ffmpeg & atomicparsley` to work
RUN apk add --no-cache libgcc libstdc++ ca-certificates libcrypto1.1 libssl1.1 libgomp expat git
RUN apk add --no-cache nginx sudo
RUN apk add --no-cache nginx sudo imagemagick
# Install php extensions
RUN install-php-extensions mysqli pgsql pdo_mysql pdo_pgsql gmp gmagick redis

View file

@ -48,12 +48,14 @@ class RouteServiceProvider extends ServiceProvider
{
$this->configureRateLimiting();
$this->routes(function () {
// Ensure route bindings are out of the `$this->routes()` callable, otherwise route caching won't
// take our custom bindings into account.
Route::model('userId', User::class);
Route::bind('userSlug', function ($value) {
return User::where('slug', $value)->first();
});
$this->routes(function () {
Route::prefix('api')
->middleware('api')
->group(base_path('routes/api.php'));