Skip to content

[7.x] Updating the make commands to use a custom views path#34050

Closed
arcanedev-maroc wants to merge 1 commit intolaravel:7.xfrom
arcanedev-maroc:fixing-custom-views-folder
Closed

[7.x] Updating the make commands to use a custom views path#34050
arcanedev-maroc wants to merge 1 commit intolaravel:7.xfrom
arcanedev-maroc:fixing-custom-views-folder

Conversation

@arcanedev-maroc
Copy link
Copy Markdown
Contributor

This PR fix an issue when using a custom folder structure. In my case, the views folder is located in the base path.

This can be achieved by setting the custom views folder in config file:

<?php

// config/view.php

return [

    //...

    'paths' => [
        base_path('views'), // Instead of the default: resource_path('views')
    ],

    //...
];

When running commands like:

php artisan make:component CustomComponent
php artisan make:mail InvoicePaid --markdown=mails.invoice.paid
php artisan make:notification InvoicePaid --markdown=notifications.invoice.paid

It creates the resources/views/{new-blade-files} instead of views/{new-blade-files}

NOTE: Let me know if i've missed a console commad that generates blade files 👍

This is related to (component, mail, notification) make commands
@taylorotwell
Copy link
Copy Markdown
Member

You could put this method in the base GeneratorCommand.

@arcanedev-maroc
Copy link
Copy Markdown
Contributor Author

arcanedev-maroc commented Aug 28, 2020

Do you mean: moving/refactoring the viewsDirectory method into GeneratorCommand ?

Something like this: https://github.com/arcanedev-maroc/framework/commit/8df11245a8132c96dc52cc851a974265821d2483 ?

@arcanedev-maroc
Copy link
Copy Markdown
Contributor Author

ping @taylorotwell

@arcanedev-maroc
Copy link
Copy Markdown
Contributor Author

@taylorotwell @driesvints @GrahamCampbell can you review and reopen this PR ?

@driesvints
Copy link
Copy Markdown
Member

@arcanedev-maroc just send in a new one please

@arcanedev-maroc
Copy link
Copy Markdown
Contributor Author

@driesvints Done

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

Successfully merging this pull request may close these issues.

3 participants