Laravel-activitylog: Unable to locate publishable resources

Created on 13 Feb 2020  路  3Comments  路  Source: spatie/laravel-activitylog

The command php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="migrations" just gives us:
Unable to locate publishable resources
We have all the models in a "Models" folder. Can it be the case here?

question

Most helpful comment

Ohh, my. So sorry! Thanks!

All 3 comments

Hey,
could it be that you already have a class named CreateActivityLogTable? The models aren't important for the publish step.

https://github.com/spatie/laravel-activitylog/blob/553449686115b3ca0dfffb152699204386f9ed52/src/ActivitylogServiceProvider.php#L22-L28

Ohh, my. So sorry! Thanks!

same issue

class ActivitylogServiceProvider extends PackageServiceProvider
{
    public function configurePackage(Package $package): void
    {
        $package
        ->name('laravel-activitylog')
        ->hasConfigFile('activitylog')
        ->hasMigrations([
            'CreateActivityLogTable',
            'AddEventColumnToActivityLogTable',
            'AddBatchUuidColumnToActivityLogTable',
        ])
        ->hasCommand(CleanActivitylogCommand::class);
    }

    public function registeringPackage()
    {
        $this->app->bind(ActivityLogger::class);

        $this->app->singleton(LogBatch::class);

        $this->app->singleton(CauserResolver::class);

        $this->app->singleton(ActivityLogStatus::class);
    }

    public static function determineActivityModel(): string
    {
        $activityModel = config('activitylog.activity_model') ?? ActivityModel::class;

        if (! is_a($activityModel, Activity::class, true)
            || ! is_a($activityModel, Model::class, true)) {
            throw InvalidConfiguration::modelIsNotValid($activityModel);
        }

        return $activityModel;
    }

    public static function getActivityModelInstance(): ActivityContract
    {
        $activityModelClassName = self::determineActivityModel();

        return new $activityModelClassName();
    }
}
Was this page helpful?
0 / 5 - 0 ratings