Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 5.1 Way\Generators migration.txt template file not found problem. #121

Closed
candasm opened this issue Feb 22, 2017 · 5 comments
Closed

Comments

@candasm
Copy link

candasm commented Feb 22, 2017

Hey @Xethron,

I wanted use your package with Laravel 5.1. When I run artisan migrate:generate command. This error appeared.

[Way\Generators\Filesystem\FileNotFound]
.../vendor/way/generators/src/Way/Generators/templates/migration.txt

Seems like you extended Way\generators under your username But migration template path is hardcoded so it prompts error because of path does not exists. Also I can not install way\generators for laravel 5 because of original way\generators require's laravel 4 packages.

@candasm candasm changed the title Laravel 5.1 Way\Generators migration.txt template file not found problem. [bug] Laravel 5.1 Way\Generators migration.txt template file not found problem. Feb 22, 2017
@endachao
Copy link

I have also encountered

@endachao
Copy link

This problem is caused by the path to the configuration file

I found a solution

New file /config/generators.config.php

Write the following

/**
 * Created by PhpStorm.
 * User: YuanChao <endachao@gmail.com>
 * Date: 2017/2/23
 */

return [

    /*
    |--------------------------------------------------------------------------
    | Where the templates for the generators are stored...
    |--------------------------------------------------------------------------
    |
    */
    'model_template_path' => base_path('vendor/xethron/laravel-4-generators/src/Way/Generators/templates/model.txt'),

    'scaffold_model_template_path' => base_path('vendor/xethron/laravel-4-generators/src/Way/Generators/templates/scaffolding/model.txt'),

    'controller_template_path' => base_path('vendor/xethron/laravel-4-generators/src/Way/Generators/templates/controller.txt'),

    'scaffold_controller_template_path' => base_path('vendor/xethron/laravel-4-generators/src/Way/Generators/templates/scaffolding/controller.txt'),

    'migration_template_path' => base_path('vendor/xethron/laravel-4-generators/src/Way/Generators/templates/migration.txt'),

    'seed_template_path' => base_path('vendor/xethron/laravel-4-generators/src/Way/Generators/templates/seed.txt'),

    'view_template_path' => base_path('vendor/xethron/laravel-4-generators/src/Way/Generators/templates/view.txt'),


    /*
    |--------------------------------------------------------------------------
    | Where the generated files will be saved...
    |--------------------------------------------------------------------------
    |
    */
    'model_target_path'   => app_path(),

    'controller_target_path'   => app_path('Http/Controllers'),

    'migration_target_path'   => base_path('database/migrations'),

    'seed_target_path'   => base_path('database/seeds'),

    'view_target_path'   => base_path('resources/views')

];

The problem is solved

@baochiharris
Copy link

thanks you very much.

@candasm
Copy link
Author

candasm commented Feb 23, 2017

Hello @yccphp,

Actually before I open issue here, I did the same thing as your answer. But the main problem comes because of composer.json required packages needs to be updated for laravel 5 versions.

@Xethron
Copy link
Owner

Xethron commented Feb 23, 2017

Thanks to everyone for helping fix this. I have updated Way/Generators with the new path: Xethron/Laravel-4-Generators@1ba6e6c

Doing a composer update should fix the problem

@Xethron Xethron closed this as completed Feb 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants