src/Screen/Fields/Picture.php
public function targetId(): self
    {
        $this->set('target', 'id');

        $this->addBeforeRender(function () {
            $value = (string) $this->get('value');

            if (! ctype_digit($value)) {
                return;
            }

            /** @var Attachment $attach */
            $attach = Dashboard::model(Attachment::class);

            $url = optional($attach::find($value))->url();

            $this->set('url', $url);
        });

        return $this;
    }
public function targetId(): self
    {
        $this->set('target', 'id');

        $this->addBeforeRender(function () {
            $value = (string) $this->get('value');

            if (! ctype_digit($value)) {
                return;
            }

            /** @var Attachment $attach */
            $attach = Dashboard::model(Attachment::class);

            $url = optional($attach::find($value))->url();

            $this->set('url', $url);
        });

        return $this;
    }
public function targetId ( ) : self { $ this -> set ( 'target' , 'id' ) ; $ this -> addBeforeRender ( function ( ) { $ value = ( string ) $ this -> get ( 'value' ) ; if ( ! ctype_digit ( $ value ) ) { return ; } /** @var Attachment $attach */ $ attach = Dashboard :: model ( Attachment :: class ) ; $ url = optional ( $ attach :: find ( $ value ) ) -> url ( ) ; $ this -> set ( 'url' , $ url ) ; } ) ; return $ this ; }
The stored value will be in the form
of id attachment.

@return self
The stored value will be in the form of id attachment .