Parse Laravel projects into Stellify's database-driven development format.
Install the package via Composer:
composer require stellify/laravelThe service provider will be automatically discovered by Laravel.
Create a new database where your Laravel project will be exported. This can be:
- A local MySQL database on your machine
- A PostgreSQL database
- A hosted database (AWS RDS, DigitalOcean, etc.)
- Any database supported by Laravel
# MySQL
CREATE DATABASE stellify_export CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# PostgreSQL
CREATE DATABASE stellify_export;Add the export database connection to config/database.php:
'connections' => [
// ... existing connections
'stellify' => [
'driver' => env('STELLIFY_DB_DRIVER', 'mysql'),
'host' => env('STELLIFY_DB_HOST', '127.0.0.1'),
'port' => env('STELLIFY_DB_PORT', '3306'),
'database' => env('STELLIFY_DB_DATABASE', 'stellify_export'),
'username' => env('STELLIFY_DB_USERNAME', 'root'),
'password' => env('STELLIFY_DB_PASSWORD', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
],Then add to your .env:
STELLIFY_DB_DRIVER=mysql
STELLIFY_DB_HOST=127.0.0.1
STELLIFY_DB_DATABASE=stellify_export
STELLIFY_DB_USERNAME=root
STELLIFY_DB_PASSWORD=Publish the Stellify migrations:
php artisan vendor:publish --tag=stellify-migrationsThen run the migrations (they automatically use the stellify connection):
php artisan migrateThis will create all the required tables in your export database.
-
Export your Laravel project to your database:
php artisan stellify:export
-
Configure Stellify platform to connect to your database:
- Log into Stellify.io
- Go to Project Settings
- Enter your database credentials (the same ones from your
.env) - Stellify will now read your project from your database
-
Start developing in Stellify's collaborative IDE!
Export your entire Laravel project:
php artisan stellify:exportExport only routes:
php artisan stellify:export --only=routesExport only controllers and models:
php artisan stellify:export --only=controllers,modelsAvailable types:
routes- Laravel routescontrollers- Controller classesmodels- Eloquent modelsconfig- Configuration filesviews- Blade templates (HTML elements)
Export only files from a specific directory:
php artisan stellify:export --path=app/ServicesExclude specific directories:
php artisan stellify:export --exclude=tests,vendorUse a different database connection:
php artisan stellify:export --connection=my_stellify_connectionThe parser exports your Laravel project into the following Stellify database tables:
All directory structures are mapped, including:
- Controllers
- Models
- Middleware
- Services
- Views
- Custom app directories
PHP class files with metadata:
- Namespace
- Class name
- Type (class, interface, trait)
- Extends/implements relationships
All class methods and functions with:
- Method name
- Visibility (public, protected, private)
- Parameters
- Method body structure
Individual code statements:
- Assignments
- Returns
- Conditionals (if/else)
- Loops (for, foreach, while)
Atomic code elements:
- Variables
- Operators
- Method calls
- Static calls
- Literals (strings, numbers)
All Laravel routes with:
- HTTP method
- Path
- Controller and method
- Middleware
- Named routes
- Route parameters
HTML elements from Blade templates:
- DOM structure
- Attributes
- Text content
- Parent-child relationships
- Linked to view names
Configuration files converted to key-value pairs:
- All files from
config/directory - Nested arrays flattened with dot notation
- e.g.,
database.connections.mysql→ value
- Install the package in your Laravel project
- Configure your Stellify database connection
- Run the export command
- Open your project in Stellify IDE
- Start collaborative development!
The parser uses PHP-Parser (nikic/php-parser) to convert PHP code into an Abstract Syntax Tree (AST), then transforms that into Stellify's JSON-based format and stores it in your own database.
Architecture:
- You run
php artisan stellify:exportin your Laravel project - The package parses your code and exports it to your MySQL database
- You configure Stellify platform with your database credentials
- Stellify reads from your database to display and edit your project
This approach means:
- ✅ You own your data (it's in your database)
- ✅ Works with local or hosted databases
- ✅ Perfect for self-hosted scenarios
- ✅ No data sent to Stellify servers during export
This enables:
- ✅ Real-time collaborative editing
- ✅ Automatic refactoring across your entire application
- ✅ AI-powered code optimization
- ✅ No local development environment needed
- PHP 8.1 or higher
- Laravel 10.x or 11.x
- Any Laravel-supported database (MySQL, PostgreSQL, SQLite, SQL Server)
- Database credentials to configure Stellify platform
Make sure your .env file has the correct database credentials for your export database. Test the connection:
php artisan tinker
> DB::connection('stellify')->getPdo()If you see "could not find driver", you may need to install the MySQL PDO extension:
# Ubuntu/Debian
sudo apt-get install php-mysql
# macOS with Homebrew
brew install php@8.1 # or your PHP versionSome files may fail to parse if they contain syntax errors. The command will continue parsing other files and output which files failed.
For very large projects, you may need to increase PHP's memory limit:
php -d memory_limit=512M artisan stellify:exportFor issues, questions, or feature requests, please visit:
or email:
MIT License - see LICENSE file for details