8000 Eloquent retrieved event not firing · Issue #538 · corcel/corcel · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Eloquent retrieved event not firing #538
Open
@jlafosse

Description

@jlafosse
  • Corcel Version: 2.6.0
  • Framework Name & Version: Laravel 5.6.0
  • PHP Version: 7.3.25
  • Database Driver & Version: 5.5.68-MariaDB

Description:

The Eloquent retrieved event within a model that extends Corcel/Model/Post does not fire. It appears that the newFromBuilder() method within the Corcel/Model/Post.php class is missing the following line:

$model->fireModelEvent('retrieved', false);

If I replicate the newFromBuilder() method that exists in the Corcel/Model.php file into my own class, it works as expected.

Steps To Reproduce:

`
namespace App\Models\Plus;

class Post extends \Corcel\Model\Post
{
protected $connection = 'wordpress';

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

    self::retrieved( function( $post ) {
        \Log::error( $post );
    });

}

}
`

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

      0