Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"michelf/php-markdown": "^2.0",
"mnapoli/front-yaml": "^2.0",
"nunomaduro/collision": "^8.1",
"ramsey/uuid": "^4.9",
"spatie/laravel-ignition": "^2.4",
"symfony/console": "^6.0 || ^7.0",
"symfony/error-handler": "^6.0 || ^7.0",
Expand Down
8 changes: 4 additions & 4 deletions src/Console/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function fire()
if ($this->input->getOption('watch')) {
return $this->watch();
}

return $this->build();
}

Expand Down Expand Up @@ -124,14 +124,14 @@ private function watch()
$affectedFiles = 0;

foreach ($currentTimestamps as $file => $mtime) {
if (!isset($fileTimestamps[$file]) || $fileTimestamps[$file] !== $mtime) {
if (! isset($fileTimestamps[$file]) || $fileTimestamps[$file] !== $mtime) {
$affectedFiles++;
$this->consoleOutput->writeln('<info>File changed: ' . $file . '</info>');
}
}

foreach ($fileTimestamps as $file => $mtime) {
if (!isset($currentTimestamps[$file])) {
if (! isset($currentTimestamps[$file])) {
$affectedFiles++;
$this->consoleOutput->writeln('<info>File deleted: ' . $file . '</info>');
}
Expand Down Expand Up @@ -221,7 +221,7 @@ private function confirmDestination()
if ($this->input->getOption('quiet') || $this->input->getOption('watch')) {
return true;
}

$customPath = Arr::get($this->app->config, 'build.destination');

if ($customPath && strpos($customPath, 'build_') !== 0 && file_exists($customPath)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div>
{{ $slot }}
</div>

@once
<script>
alert('This is the component')
</script>
@endonce
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div>
<p>MAIN LAYOUT</p>
<div>
@yield('body')
</div>
</div>
9 changes: 9 additions & 0 deletions tests/snapshots/blade-with-once/source/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@extends('_layouts.main')

@section('body')
Hello world!

<x-alert>Slot 1</x-alert>

<x-alert>Slot 2</x-alert>
@endsection
19 changes: 19 additions & 0 deletions tests/snapshots/blade-with-once_snapshot/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div>
<p>MAIN LAYOUT</p>
<div>
Hello world!

<div>
Slot 1
</div>

<script>
alert('This is the component')
</script>

<div>
Slot 2
</div>

</div>
</div>