Configure your project by creating or updating a settings.json file at the project's root. If you already have a .vscode/settings.json file, skip the first two steps.
Open the command palette in VSCode:
CTRL + SHIFT + P (Windows)
CMD + SHIFT + P (Mac OS)
Type Preferences: Open Workspace Settings (JSON).
In the .vscode/settings.json file, copy and paste the following settings:
{
"spark.files.include": [
"php"
], // The file extensions to watch for changes. Example: "php"
"spark.files.exclude": [
"**/vendor/**",
"**/.*/**"
], // The files to exclude from watching. Example: "**/vendor/**", "**/.*/**"
"spark.files.watch": [
"helpers"
], // The types of files to watch for changes. Example: "helpers"
"spark.files.showPath": true, // Show the path of the file in the list of files to watch
}
Restart VS Code
Your project is now set up to automatically format code upon saving.
Features
Cache
Title
Purpose
Spark: Clear Cache
Clears the current system caches
Spark: Cache Info
Shows file cache information in the current system
CodeIgniter
Title
Purpose
Spark: Filter Check
Check filters for a route
Spark: Namespaces
Verifies your namespaces are setup correctly
Spark: Optimize
Optimize for production
Spark: PHP INI check
Check your php.ini settings
Spark: List Routes
Displays all routes
Spark: Start Server
Launches the CodeIgniter PHP-Development Server
Database
Title
Purpose
Spark: DB Create
Create a new database schema
Spark: DB Seed
Runs the specified seeder to populate known data into the database
Spark: DB Table
Retrieves information on the selected table
Spark: Migrate
Locates and runs all new migrations against the database
Spark: Migrate Refresh
Refreshes the database state by first rolling back all migrations, and then migrating all
Spark: Migrate Rollback
Run the "down" method for all migrations
Spark: Migrate Status
Displays a list of all migrations and whether they've been run or not
Encryption
Title
Purpose
Spark: Generate Key
Generates a new encryption key and writes it in an .env file