Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dispatch method instead of fire method. #346

Open
xharpenParksuhyeon opened this issue Jan 19, 2023 · 0 comments
Open

Use dispatch method instead of fire method. #346

xharpenParksuhyeon opened this issue Jan 19, 2023 · 0 comments

Comments

@xharpenParksuhyeon
Copy link
Member

xharpenParksuhyeon commented Jan 19, 2023

https://laravel.com/docs/5.8/upgrade#events

The fire Method
Likelihood Of Impact: Low

The fire method (which was deprecated in Laravel 5.4) of the Illuminate\Events\Dispatcher class [has been removed](https://github.com/laravel/framework/pull/26392). You should use the dispatch method instead.

Event::fire Method가 삭제되고 Event::dispatch 메소드를 사용되도록 라라벨 코어가 수정되었습니다.

라라벨 5.5 버전에도 Event::dispatch 메소드는 지원되고 있는 걸 확인했습니다.
그래서 fire 메소드를 사용하고 있는 부분을 dispatch 로 변경해 해결했습니다.

아래 코드는 라라벨 5.5 쪽에 작성되어 있는 코드 중 일부 입니다.
https://laravel.com/api/5.5/Illuminate/Events/Dispatcher.html

   /**
     * Flush a set of pushed events.
     *
     * @param  string  $event
     * @return void
     */
    public function flush($event)
    {
        $this->dispatch($event.'_pushed');
    }

    /**
     * Register an event subscriber with the dispatcher.
     *
     * @param  object|string  $subscriber
     * @return void
     */
    public function subscribe($subscriber)
    {
        $subscriber = $this->resolveSubscriber($subscriber);

        $subscriber->subscribe($this);
    }
@xharpenParksuhyeon xharpenParksuhyeon added this to the Laravel 5.5 to 6.x milestone Jan 19, 2023
@xharpenParksuhyeon xharpenParksuhyeon self-assigned this Jan 19, 2023
@xharpenParksuhyeon xharpenParksuhyeon changed the title [laravel/5.8] Remove fire method [laravel/5.8] Use dispatch method instead of fire method. Jan 19, 2023
@xharpenParksuhyeon xharpenParksuhyeon changed the title [laravel/5.8] Use dispatch method instead of fire method. Use dispatch method instead of fire method. Jan 19, 2023
xharpenParksuhyeon added a commit that referenced this issue Feb 1, 2023
* #348 Primary Key로 문자열을 사용하는 모델에 keyType 프로퍼티 추가

* #347 instance_route('slug', ['slug' => '']) 라우터 파라미터 값에 '' 사용 시 오류 발생

* #346 Use dispatch method instead of fire method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant