Skip to content

Commit

Permalink
Fix frontend setup
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Nov 30, 2023
1 parent 5ff5c26 commit 038a222
Show file tree
Hide file tree
Showing 8 changed files with 295 additions and 1,372 deletions.
14 changes: 11 additions & 3 deletions app/Livewire/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class Form extends Component implements HasForms

public $data = [];

public $foo = null;

public function mount()
{
if (! app()->environment('local')) {
Expand All @@ -27,7 +25,17 @@ public function mount()
protected function getFormSchema(): array
{
return [
Forms\Components\DateTimePicker::make('date')->native(false),
Forms\Components\Builder::make('test')
->blocks([
Forms\Components\Builder\Block::make('one')
->schema([
Forms\Components\TextInput::make('one'),
]),
Forms\Components\Builder\Block::make('two')
->schema([
Forms\Components\TextInput::make('two'),
]),
])
];
}

Expand Down
1,596 changes: 260 additions & 1,336 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
Expand Down
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
Expand Down
2 changes: 0 additions & 2 deletions resources/css/app.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import '../../vendor/filament/forms/dist/index.css';

@tailwind base;
@tailwind components;
@tailwind utilities;
20 changes: 10 additions & 10 deletions resources/views/components/layouts/app.blade.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta charset="utf-8" />

<meta name="application-name" content="{{ config('app.name') }}">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="application-name" content="{{ config('app.name') }}" />
<meta name="csrf-token" content="{{ csrf_token() }}" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>{{ config('app.name') }}</title>

<style>[x-cloak] { display: none !important; }</style>
@livewireStyles
<style>
[x-cloak] {
display: none !important;
}
</style>

@filamentStyles
@vite('resources/css/app.css')
</head>

<body class="antialiased">
{{ $slot }}

@livewire('notifications')

@livewireScripts
@filamentScripts
@vite('resources/js/app.js')
<script src="//unpkg.com/alpinejs" defer></script>
</body>
</html>
25 changes: 7 additions & 18 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
const colors = require('tailwindcss/colors')
import preset from './vendor/filament/support/tailwind.config.preset'

module.exports = {
content: ['./resources/**/*.blade.php', './vendor/filament/**/*.blade.php'],
darkMode: 'class',
theme: {
extend: {
colors: {
danger: colors.rose,
primary: colors.blue,
secondary: colors.gray,
success: colors.green,
warning: colors.yellow,
},
},
},
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
7 changes: 5 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import laravel, { refreshPaths } from 'laravel-vite-plugin'

export default defineConfig({
plugins: [
laravel({
laravel.default({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: [
...refreshPaths,
'app/Http/Livewire/**',
'app/Filament/**',
'app/Forms/Components/**',
'app/Livewire/**',
'app/Infolists/Components/**',
'app/Providers/Filament/**',
'app/Tables/Columns/**',
],
}),
Expand Down

0 comments on commit 038a222

Please sign in to comment.