Laravel-admin: Also publish migration and views?

Created on 30 Jan 2017  路  8Comments  路  Source: z-song/laravel-admin

Currently php artisan migrate:refresh is throwing errors because it can't find the migration file from laravel-admin, maybe it's an idea to make the migration publishable with php artisan vendor:publish?

And maybe publish the views too so they can easily be modified?

Most helpful comment

@alpharameeztech @llxx-lord-xxll
You can change the namespace by adding app('view')->prependNamespace('admin', resource_path('views/admin')); to AppServiceProvider.php

All 8 comments

One thing about the views, you can override any of the view files by putting a replacement file in resources/views/admin following the structure of vendor/encore/laravel-admin/views. Laravel will try to load anything in that directory first as long as it's namespaced with admin::.

...and there's only one migration file in /vendor/encore/laravel-admin/migrations so it's easy enough to copy it if you need to.

Hi @jonphipps, I glad to hear that we can override all views but we need to put the replacement files in resources/views/vendor/admin instead of resources/views/admin. Just the missing vendor in the path. ;)

@jonphipps where should i change the namespace? as i need to change the layout of the Views file.

@ihsanberahim I need to publish the views folder from the Laravel admin vendor directory. I have tried creating the same views folder structure under my Resources folder but Laravel couldn't recognize it.

Same requirement is also needed for me

@alpharameeztech @llxx-lord-xxll
You can change the namespace by adding app('view')->prependNamespace('admin', resource_path('views/admin')); to AppServiceProvider.php

@llxx-lord-xxll well i figured that out. Just copy and vendor/laravel-admin/resources/view folder and paste it over project-root-dir/resources/views/vendor/laravel-admin

Thanks to both of you @alpharameeztech @z-song

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhenyangze picture zhenyangze  路  3Comments

chenyongmin picture chenyongmin  路  3Comments

cdhraesaemer picture cdhraesaemer  路  3Comments

joernroeder picture joernroeder  路  3Comments

greentornado picture greentornado  路  3Comments