Skip to content

Commit

Permalink
Enable strict mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelElrafa committed Nov 6, 2024
1 parent 85c40e2 commit 63a331a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

namespace App\Providers;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider;
use Smpita\TypeAs\TypeAs;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -20,7 +22,8 @@ public function register(): void
*/
public function boot(): void
{
/** @var \Illuminate\Foundation\Vite $this */
Vite::macro('image', fn (string $asset) => $this->asset("resources/images/{$asset}"));
Model::shouldBeStrict(! $this->app->isProduction());

Vite::macro('image', fn (string $asset) => TypeAs::class(\Illuminate\Foundation\Vite::class, $this)->asset("resources/images/{$asset}"));
}
}

0 comments on commit 63a331a

Please sign in to comment.