Shikiju Shikiju - 1 month ago 22
PHP Question

Laravel 5.3 project vendor:publish gives FileNotFoundException

In a new laravel installation i have included several custom build packages. these packages are writing their migration files when i execute

php artisan vendor:publish


however this now gives the following error

[League\Flysystem\FileNotFoundException] File not found at path: 016_01_29_094442_create_xxxxx_2_f_a_tokens_table.php


which is not strange since the actual filename is: 2016_01_29_094442_xxxxx_2_f_a_tokens_table.php

This is what my ServiceProvider looks like:

class TwoFAServiceProvider extends ServiceProvider {

---- SNIP -----

public function boot() {
---- SNIP -----
$this->publishMigrations();
}

public function publishMigrations() {
$this->publishes([
__DIR__ . '/../../migrations/' => base_path('/database/migrations'),
], 'migrations');
}
}


Does anyone know why this is occuring while yesterday this worked perfectly?

Answer

Had the same problem. You should probably use backslashes in your paths, depending on your file system. See if this works:

public function publishMigrations() {
    $this->publishes([
        __DIR__ . '\..\..\migrations\\' => base_path('database\migrations'),
    ], 'migrations');
}
Comments