Forms - v1.0.0-beta1
Troubleshooting
Solutions to common issues with ArtisanPack UI Forms.
Installation Issues
Views not publishing
Problem: Views don't publish or changes aren't reflected.
Solution:
# Force publish
php artisan vendor:publish --tag=forms-views --force
# Clear view cache
php artisan view:clear
Migration errors
Problem: Migrations fail to run.
Solution:
# Check migration status
php artisan migrate:status
# Verify database connection
php artisan db:show
# Run migrations with verbose output
php artisan migrate -v
Config not loading
Problem: Configuration changes not taking effect.
Solution:
# Clear config cache
php artisan config:clear
# Verify config exists
php artisan config:show artisanpack.forms
Form Display Issues
Form not rendering
Problem: Form shows blank or error.
Solution:
- Verify form exists and is active:
$form = Form::where('slug', 'contact')->first();
dd($form->is_active);
-
Check for Livewire errors in browser console
-
Ensure Livewire is properly installed:
php artisan livewire:publish --config
Styles not loading
Problem: Form displays without styling.
Solution:
- Ensure CSS is compiled:
npm run build
- Check Tailwind config includes forms views:
// tailwind.config.js
content: [
'./vendor/artisanpack-ui/forms/resources/views/**/*.blade.php',
]
JavaScript errors
Problem: Console shows JavaScript errors.
Solution:
- Ensure Alpine.js is loaded (included with Livewire 3)
- Check for conflicting scripts
- Verify
@livewireScriptsis in layout
Submission Issues
Form not submitting
Problem: Submit button doesn't work.
Solution:
- Check browser console for errors
- Verify
wire:submitis on form element - Check rate limiting isn't blocking:
// Temporarily disable
'spam_protection' => ['rate_limit' => ['enabled' => false]]
Validation not working
Problem: Required fields not validating.
Solution:
- Verify field has
required => true - Check validation rules in component
- Enable debug mode:
dd($this->rules());
Submissions not saving
Problem: Submissions complete but no data stored.
Solution:
- Check database for errors:
DB::enableQueryLog();
// Submit form
dd(DB::getQueryLog());
- Verify
store_submissionsis enabled:
'submissions' => ['store_submissions' => true]
File Upload Issues
Upload fails silently
Problem: File upload doesn't save.
Solution:
- Check PHP upload limits:
php -i | grep upload_max
php -i | grep post_max
- Verify disk exists:
Storage::disk('form-uploads')->exists('');
- Check permissions on storage directory
Invalid file type
Problem: Valid files rejected.
Solution:
- Verify MIME type is allowed:
'uploads' => [
'allowed_mimes' => [
'image/jpeg',
// Add your MIME type
],
],
- Check actual file MIME type:
$file->getMimeType();
Files not downloading
Problem: Download links don't work.
Solution:
- Verify file exists:
Storage::disk($upload->disk)->exists($upload->path);
- Check authorization policy
- Create storage link if using public disk:
php artisan storage:link
Email Issues
Notifications not sending
Problem: No emails after submission.
Solution:
- Check queue is running:
php artisan queue:work
- Verify mail configuration:
php artisan tinker
Mail::raw('Test', fn($m) => $m->to('test@example.com'));
- Check notification is active:
$form->notifications()->where('is_active', true)->get();
Wrong recipient
Problem: Emails going to wrong address.
Solution:
- Verify recipient configuration
- Check if
recipient_typeisfieldvsstatic - Verify field name matches
Performance Issues
Slow form loading
Problem: Forms take long to load.
Solution:
- Enable query caching
- Eager load relationships:
$form->load('fields', 'steps');
- Check for N+1 queries:
composer require barryvdh/laravel-debugbar --dev
Queue backing up
Problem: Notifications/webhooks delayed.
Solution:
- Run more workers:
php artisan queue:work --queue=notifications,webhooks
- Use Horizon for queue management
- Check for failed jobs:
php artisan queue:failed
Authorization Issues
Access denied
Problem: Users can't access forms.
Solution:
- Check policy:
Gate::inspect('view', $form);
- Verify ownership settings:
'authorization' => [
'restrict_by_owner' => false, // Permissive mode
]
- Check admin bypass:
'allow_admin_bypass' => true
Can't delete forms
Problem: Delete button doesn't work.
Solution:
- Check
deletepolicy permission - Verify no foreign key constraints
- Check JavaScript errors
Webhook Issues
Webhooks not sending
Problem: No webhook requests.
Solution:
- Verify enabled:
'webhooks' => ['enabled' => true]
- Check queue is running
- Test URL manually:
curl -X POST https://your-webhook-url
Invalid signature
Problem: Receiving endpoint rejects webhook.
Solution:
- Verify secret matches
- Check signature calculation:
hash_hmac('sha256', $payload, $secret);
- Ensure raw body is used for verification
Debugging Tips
Enable debug logging
// In a service provider
Log::debug('Form submitted', [
'form' => $form->id,
'data' => $formData,
]);
Check logs
tail -f storage/logs/laravel.log
Use Laravel Telescope
composer require laravel/telescope --dev
php artisan telescope:install
php artisan migrate
Test in isolation
php artisan tinker
>>> $form = Form::first();
>>> $form->fields;
>>> SubmissionService::create($form, ['email' => 'test@example.com']);
Getting Help
If you can't resolve an issue:
- Check the FAQ
- Search existing issues on GitLab
- Create a detailed bug report with:
- Laravel and package versions
- Steps to reproduce
- Error messages
- Relevant configuration
Contact: support@artisanpackui.dev