- Laravel Artisan
- Run artisan commands from the command palette
- 388 Installs
-
This extension is allowed to:
- Read & Write Files
- Launch Subprocesses
Readme
Laravel Artisan allows you to run artisan tasks from Nova's command palette and open commonly used files directories quickly.
Requirements
Laravel Artisan requires a working Laravel project and artisan (obvs). The extension also assumes that laravel is at the root of your Nova project. There's currently no external dependencies as this extension simply runs shell commands.
Usage
Running Laravel Artisan commands:
- Select the Editor → Laravel Artisan menu item; or
- Open the command palette and type
Laravel Artisan
followed by the command you'd like to run. This extension supports single-fire commands like Cache clearing and also commands that need a name, like creating models and controllers. It also allows additional arguments like--seed
Currently supported commands are:
- Cache config
- Clear config cache
- Clear cache
- Forget cache
- Seed database
- Wipe database
- Migrate
- Migrate fresh
- Migrate refresh
- Migrate reset
- Migrate rollback
- Prune models
- Create notifications migration
and all make commands
With more to come in subsequent releases.
Quickly open common directories
Need to go to a Controller and wanna use the command palette. Ok, so you type your controller name into the open quickly palette and you get a list including with a bunch of similarly named files and spend a few seconds tapping through the list to find what you what you want and find it really annoying? Oh, that doesn't annoy you? Well it annoys me, so I've added commands to list commonly accessed directories, saving you a few taps.
Currently opens:
- Views (For blade, Vue, React and livewire)
- Components
- Livewire components
- Layouts (Vue/React)
- Controllers
- Middlewares
- Providers
- Models
- Factories
- Migrations
- Seeders
I recommend mapping these to keyboard shortcuts to navigate your Laravel project even faster.
Navigating views, components and layouts
Since these directories have subdirectories, there are two methods for navigating them Open
and Browse
Open
will return a list of all files for quick filtering
Browse
returns files in the root of the directory and lists subdirectories that you manually navigate into.
Configuration
To configure global preferences, open Extensions → Extension Library then select Laravel Artisan's Preferences tab. From here you can specify your preferred shell and enable/disable command success messages.
Contribution and feedback
I'll be adding more commands and maybe some extra functionality soon, if there's anything you'd like to see or find any bugs, feel free to open an issue on GitHub.
Changelog
Version 1.3 🎉
NEW
- Go straight to views, components and layouts with
Open
andBrowse
commands, works for vanilla Laravel, Livewire and inertia projects (Vue/React). This is just the first implementation of this feature, with improvements to come. - More descriptive error messages for
Create
commands with a list of available options. - DB Wipe now shows a confirmation message before running.
- Added workspace configuration
Fixed
Some typos
Version 1.2
NEW
Added Laravel 11 config commands
Version 1.1 🗂️
NEW
Open common Laravel folders from the command line with Open...
Nova's open quickly can be a bit quirky at times, so skip a step and directly list and open things like models and controllers by viewing those folders directly. You can use keywords to open these directly in the command palette, but I recommend attaching some of these to keyboard shortcuts.
Currently opens:
- Controllers
- Middlewares
- Providers
- Models
- Factories
- Migrations
- Seeders
Version 1.0
Initial release 🎉
License
MIT License
Copyright (c) 2023 Ash Joseph
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.