Skip to content

Files are not uploaded #10

@arthurkirkosa

Description

@arthurkirkosa
<?php namespace Acme\Entities;

use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;

use Hash;

use Laracasts\Presenter\PresentableTrait;
use Watson\Validating\ValidatingTrait;
use Codesleeve\Stapler\ORM\StaplerableInterface;
use Codesleeve\Stapler\ORM\EloquentTrait;

class User extends \Eloquent implements UserInterface, RemindableInterface, StaplerableInterface {

    use UserTrait, RemindableTrait, PresentableTrait, ValidatingTrait, EloquentTrait;

public function __construct(array $attributes = array()) {
        $this->hasAttachedFile('avatar', [
            'styles' => [
                'medium' => '300x300',
                'thumb' => '100x100',
                'gravatar' => '74x74'
            ],
            'url' => '/img/:attachment/:id_partition/:style/:filename',
            'default_url' => '/img/missing.png'
        ]);

        parent::__construct($attributes);
    }

    public static function boot()
    {
        parent::boot();

        static::bootStapler();
    }

The record is updated in db, but no files are stored in /public/img/avatar

What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions