Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Jan 30, 2021
1 parent 9be0f68 commit 5d8a161
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/Bazar.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Bazar\Http\Middleware\ShareComponentData;
use Closure;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Route;

Expand Down Expand Up @@ -44,7 +43,7 @@ public static function version(): string
*/
public static function assetVersion(): ?string
{
$path = App::publicPath('mix-manifest.json');
$path = public_path('mix-manifest.json');

return is_file($path) ? md5_file($path) : null;
}
Expand Down
7 changes: 3 additions & 4 deletions src/Console/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Bazar\Database\Seeders\BazarSeeder;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\File;

class InstallCommand extends Command
Expand Down Expand Up @@ -36,10 +35,10 @@ public function handle(): int
$status = $this->call('db:seed', ['--class' => BazarSeeder::class]);
}

File::ensureDirectoryExists(App::publicPath('vendor'));
File::ensureDirectoryExists(public_path('vendor'));

if (! is_dir(App::publicPath('vendor/bazar'))) {
symlink(__DIR__.'/../../../public', App::publicPath('vendor/bazar'));
if (! is_dir(public_path('vendor/bazar'))) {
symlink(__DIR__.'/../../../public', public_path('vendor/bazar'));
}

return $status;
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Middleware/ComponentMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function handle(Request $request, Closure $next)
return $response;
}

if ($request->isMethod('GET') && $request->header('X-Inertia-Version', '') !== Bazar::assetVersion()) {
if ($request->isMethod('GET') && $request->header('X-Inertia-Version') !== Bazar::assetVersion()) {
if ($request->hasSession()) {
$request->session()->reflash();
}
Expand Down

0 comments on commit 5d8a161

Please sign in to comment.