- How do I install Laravel MakeView in my Laravel 8+ project?
- Run `composer require lanciweb/laravel-make-view` in your project root. The package integrates automatically with Laravel’s Artisan commands, requiring no additional configuration.
- Can I generate nested view folders like `resources/views/admin/posts` using dot notation?
- Yes. Use `php artisan make:view admin.posts` to create the full nested structure, including any missing intermediate folders (e.g., `admin` and `posts`). The package handles directory creation automatically.
- Does the `--crud` flag generate all standard Laravel resource views (index, show, create, edit)?
- Yes. Running `php artisan make:view posts --crud` creates `index.blade.php`, `show.blade.php`, `create.blade.php`, and `edit.blade.php` in `resources/views/posts/` with no extra setup.
- Will this package work with Laravel 10 or newer? Is there backward compatibility?
- The package officially supports Laravel 8+ and PHP 8.0+. While it may work with Laravel 10+, test it in a staging environment first, as minor breaking changes could occur in future Laravel releases.
- What happens if I try to generate a view that already exists? Does it overwrite files?
- The package silently overwrites existing files. To avoid accidental data loss, check for files manually or use `--force` (if added in future updates) or pre-check with `ls resources/views/` before running the command.
- Can I customize the generated Blade templates (e.g., add `@extends` or `@section` blocks)?
- No, the package generates basic Blade files without predefined layouts or sections. For customization, manually edit the files post-generation or extend the package via service providers to inject shared logic.
- Is there a way to integrate this with Laravel’s `make:controller` or Livewire scaffolding?
- Not natively. The package focuses solely on view generation. For workflow integration, chain commands manually (e.g., `make:controller PostController --resource` followed by `make:view posts --crud`) or build a custom script.
- Does Laravel MakeView support multi-language views (e.g., `.blade.php.lang`) or Vue/React components?
- No. It generates standard Blade files only. For multi-language support, use Laravel’s localization features post-generation. For Vue/React, consider alternatives like Laravel Mix or Inertia.js templates.
- How do I handle permission issues when running `make:view` in a shared hosting environment?
- Ensure the web server user (e.g., `www-data` or your hosting account) has write permissions to `resources/views/`. Use `chmod -R 755 resources/views` or consult your hosting provider’s file permissions guide.
- Are there alternatives to Laravel MakeView for more advanced view scaffolding?
- For custom templates or layouts, explore packages like `laravel-shift/blueprint` or `orchid/software`. For Livewire/Inertia integration, use their built-in scaffolding tools. If you need programmatic control, consider writing a custom Artisan command.