Skip to content

Spatie Medialibrary #646

@DeveloperOnCall

Description

@DeveloperOnCall

Description

In an effort to fix my hostname not identified issue I created a new Laravel install using the directions:
https://laravel-tenancy.com/docs/hyn/5.3/spatie-medialibrary


Actual behavior

When using the suggested method to attach media to a user -

// Switch the environment to use first hostname
        $environment = app(\Hyn\Tenancy\Environment::class);
        $hostname = Hostname::find(2);
        $environment->hostname($hostname);

// Retrieve your user model.
      $user = App\User::find(1);

// Add a media from url and attach it to your model.
    $user->addMediaFromUrl('http://url-to-your-media-to-attach.png')->toMediaCollection();

Seems to work without any problem, however - the image is placed in the storage/app/public/1 folder.

Expected behavior

This should put the new file into the tenant's disk.


Information

  • hyn/multi-tenant version: 5.3
  • laravel version: 5.7
  • database driver and version: MySQL 5.x
  • webserver software and version: Apache
  • php version: 7.1.x

tenancy.php config

webserver.php config


Error log


Metadata

Metadata

Assignees

Labels

supportQuestion or generic support.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions