Import & Export

Importing Laravel Projects

Importing Laravel Projects

Bring your existing Laravel projects into Stellify using the official importer. Continue developing in the platform, then export back to your repository.

Repository

stellify-laravel - Official Laravel project importer

Overview

The Laravel importer:

  • Parses your existing Laravel codebase
  • Extracts controllers, models, routes, and views
  • Uploads to Stellify platform as structured data
  • Maintains your project structure and relationships

Prerequisites

System Requirements

  • PHP 8.1 or higher
  • Composer
  • Git
  • Existing Laravel project (Laravel 8+)

Stellify Account

  • Active Stellify account
  • API token (generate in Settings)
  • Project created in Stellify

Installation

Step 1: Install Importer

In your Laravel project directory:

composer require stellify/laravel-importer --dev

Or install globally:

composer global require stellify/laravel-importer

Step 2: Configure

Publish configuration file:

php artisan vendor:publish --provider="Stellify\LaravelImporter\ServiceProvider"

Edit config/stellify.php:

return [
    'api_url' => env('STELLIFY_API_URL', 'https://api.stellisoft.com'),
    'api_token' => env('STELLIFY_API_TOKEN'),
    'project_id' => env('STELLIFY_PROJECT_ID'),
];

Step 3: Set Environment Variables

Add to your .env:

STELLIFY_API_TOKEN=your_api_token_here
STELLIFY_PROJECT_ID=your_project_uuid_here

Basic Import

Import Everything

Import your entire Laravel project:

php artisan stellify:import

This imports:

  • ✅ Controllers
  • ✅ Models
  • ✅ Routes
  • ✅ Migrations
  • ✅ Config files
  • ✅ Views (partial support)

Import Specific Parts

Controllers only:

php artisan stellify:import --controllers

Models only:

php artisan stellify:import --models

Routes only:

php artisan stellify:import --routes

Multiple types:

php artisan stellify:import --controllers --models --routes

What Gets Imported

Controllers

All files in app/Http/Controllers:

  • Class structure
  • Methods and their code
  • Dependencies (use statements)
  • Comments and documentation

Example:

// Before (your Laravel project)
app/Http/Controllers/UserController.php

// After (in Stellify)
Files → Controllers → UserController
- index()
- store()
- update()
- destroy()

Models

All files in app/Models:

  • Properties ($fillable, $hidden, $casts)
  • Relationships
  • Accessors and mutators
  • Scopes
  • Methods

Example:

// Before
app/Models/User.php

// After (in Stellify)
Files → Models → User
- Properties
- posts() relationship
- fullName() accessor

Routes

From routes/web.php and routes/api.php:

  • Route definitions
  • HTTP methods
  • Middleware
  • Route names
  • Controller mappings

Example:

// Before
Route::get('/users', [UserController::class, 'index'])->name('users.index');

// After (in Stellify)
Routes → /users (GET)
- Controller: UserController
- Method: index
- Name: users.index

Migrations

From database/migrations:

  • Table structures
  • Column definitions
  • Indexes
  • Foreign keys

Note: Migrations imported as reference. Run them in your database separately.

Config Files

From config/ directory:

  • database.php
  • filesystems.php
  • mail.php
  • services.php
  • Custom config files

Imported as Stellify configuration profiles.

Advanced Import Options

Selective Import

Import specific files:

php artisan stellify:import --file=app/Http/Controllers/UserController.php

Import specific directory:

php artisan stellify:import --directory=app/Http/Controllers/Admin

Dry Run

Preview what would be imported without actually importing:

php artisan stellify:import --dry-run

Output shows:

  • Files that would be imported
  • Potential conflicts
  • Estimated import time

Force Overwrite

Overwrite existing files in Stellify:

php artisan stellify:import --force

Warning: This replaces existing code. Use with caution.

Import with Dependencies

Include external packages:

php artisan stellify:import --with-vendors

Imports code from:

  • vendor/ directory (selectively)
  • Custom packages in packages/

Handling Conflicts

Name Conflicts

If a file with the same name exists:

Conflict detected: UserController already exists
Options:
[1] Skip
[2] Overwrite
[3] Rename to UserController_imported
[4] Cancel import

Choose option or use flags:

--skip-conflicts    # Automatically skip
--overwrite         # Automatically overwrite
--rename-conflicts  # Automatically rename

Namespace Conflicts

Importer preserves your namespace structure:

// Your code
namespace App\Http\Controllers\Admin;

// Imported as
Files → Controllers → Admin → UserController

Post-Import Steps

1. Review Imported Code

Check in Stellify:

  • Navigate to Files
  • Review controllers and models
  • Verify routes in Routes section

2. Configure Database

Set up your database connection:

  1. Go to SettingsDatabase
  2. Enter your database credentials
  3. Test connection

3. Test Functionality

Run methods in the Code Editor:

  1. Open a controller
  2. Select a method
  3. Click Run
  4. Verify output

4. Rebuild Frontend (if needed)

If using Blade templates:

  1. Use Interface Builder to recreate views
  2. Or keep Blade and export together

Limitations

Not Fully Supported

  • Blade Templates: Partially supported. Complex Blade syntax may need manual adjustment.
  • JavaScript/Vue: Frontend assets not imported. Use Stellify's bundler.
  • Custom Packages: Only standard Laravel structure supported.
  • Artisan Commands: Not imported. Recreate in Stellify if needed.
  • Tests: Not imported. Write new tests or keep in original repo.

Manual Steps Required

After import:

  • Configure database connections
  • Set up filesystem (S3, etc.)
  • Add API tokens/keys
  • Configure mail settings
  • Set up queue workers

Workflows

Workflow 1: Migrate Existing App

Goal: Move entire Laravel app to Stellify

  1. Backup your project

    git commit -am "Pre-Stellify backup"
    
  2. Import to Stellify

    php artisan stellify:import
    
  3. Configure in Stellify

    • Database
    • Filesystems
    • Services
  4. Test in Stellify

    • Run methods
    • Check routes
    • Verify database connections
  5. Export from Stellify

    • Generate updated code
    • Deploy to production

Workflow 2: Hybrid Development

Goal: Use both Laravel locally and Stellify

  1. Import specific parts

    php artisan stellify:import --controllers --models
    
  2. Develop new features in Stellify

    • Use Interface Builder
    • Write code in editor
  3. Export back to Laravel

    php artisan stellify:export
    
  4. Sync changes

    • Commit to Git
    • Deploy as usual

Workflow 3: Refactor Legacy Code

Goal: Modernize old Laravel project

  1. Import legacy code

    php artisan stellify:import
    
  2. Refactor in Stellify

    • Update controllers
    • Improve models
    • Rebuild views visually
  3. Export modernized code

    php artisan stellify:export
    
  4. Deploy improvements

Troubleshooting

Import Fails

Error: API token invalid

  • Check STELLIFY_API_TOKEN in .env
  • Regenerate token in Stellify settings
  • Verify token has correct permissions

Error: Project not found

  • Check STELLIFY_PROJECT_ID in .env
  • Verify project exists in Stellify
  • Ensure you have access to the project

Error: Syntax error in file X

  • File has invalid PHP syntax
  • Fix locally and re-import
  • Or use --skip-errors flag

Partial Import

Some files imported, others failed:

php artisan stellify:import --verbose

Review detailed logs to identify issues.

Slow Import

Large projects may take time:

  • Use selective import for specific files
  • Import in batches (controllers, then models, then routes)
  • Check network connection

Namespace Issues

Classes not resolving:

  • Verify composer.json autoload
  • Run composer dump-autoload
  • Check use statements in imported code

Command Reference

stellify:import

Import Laravel code to Stellify.

Syntax:

php artisan stellify:import [options]

Options:

--controllers       Import controllers only
--models           Import models only
--routes           Import routes only
--migrations       Import migrations only
--config           Import config files only
--file=PATH        Import specific file
--directory=PATH   Import specific directory
--dry-run          Preview without importing
--force            Overwrite existing files
--skip-conflicts   Skip conflicting files
--overwrite        Overwrite all conflicts
--rename-conflicts Rename conflicting files
--with-vendors     Include vendor packages
--verbose          Show detailed output

Examples:

# Import everything
php artisan stellify:import

# Import controllers and models
php artisan stellify:import --controllers --models

# Dry run to preview
php artisan stellify:import --dry-run

# Force overwrite existing
php artisan stellify:import --force

# Import specific file
php artisan stellify:import --file=app/Http/Controllers/UserController.php

stellify:export

Export Stellify code back to Laravel (see Exporting Code).

stellify:sync

Two-way sync between Laravel and Stellify:

php artisan stellify:sync

Detects changes in both places and merges intelligently.

Best Practices

Before Import

  1. Clean up code - Remove unused files
  2. Run tests - Ensure everything works
  3. Commit to Git - Create restore point
  4. Document custom logic - Add comments for complex code

During Import

  1. Start small - Import one controller first
  2. Verify each step - Check imported code in Stellify
  3. Use dry-run - Preview before actual import
  4. Monitor logs - Watch for errors

After Import

  1. Test thoroughly - Run all methods
  2. Configure services - Database, filesystem, etc.
  3. Update documentation - Note any manual changes needed
  4. Train team - Show Stellify to team members

Getting Help

Common Issues

Check the FAQ for solutions to common problems.

Support

  • GitHub Issues: Report bugs
  • Documentation: This guide and API docs
  • Community: Join our Discord/Slack

Example Projects

See example imports:

Next Steps


Ready to import? Clone the stellify-laravel repository and follow the setup instructions.

Previous
Code Editor

Please be aware that our documentation is under construction.