Skip to content

Commit

Permalink
24. Installing-alpinejs
Browse files Browse the repository at this point in the history
- install the alpinejs
- callout the alpinejs in the resources/js/app.js file
- The vite helper was add in the views\components\app-layout.blade.php
- Restart the  server
- Check the alpinejs. bookings\checkout.blade.php
  • Loading branch information
lessandsass committed Oct 1, 2024
1 parent 922c2ed commit ccddd89
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 1 deletion.
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
"postcss": "^8.4.47",
"tailwindcss": "^3.4.13",
"vite": "^5.0"
},
"dependencies": {
"alpinejs": "^3.14.1"
}
}
7 changes: 7 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
import './bootstrap';

import Alpine from 'alpinejs'
window.Alpine = Alpine
Alpine.start()



12 changes: 11 additions & 1 deletion resources/views/bookings/checkout.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<x-app-layout>
<div class="space-y-12">

<div>
<h2 class="text-xl font-medium mt-3">Here's what you're booking</h2>
<div class="flex mt-6 space-x-3 bg-slate-100 rounded-lg p-4">
Expand All @@ -22,10 +23,19 @@

<div>
<h2 class="text-xl font-medium mt-3">1. When for?</h2>
<div>
<div
x-data="{
picker: null
}"
x-init="
picker='abcdf'
console.log(picker)
"
>
Calender
</div>
</div>

</div>
</x-app-layout>

Expand Down
1 change: 1 addition & 0 deletions resources/views/components/app-layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<title>Bookings</title>

@vite('resources/css/app.css')
@vite(['resources/js/app.js'])

</head>
<body>
Expand Down

0 comments on commit ccddd89

Please sign in to comment.