Skip to content
This repository was archived by the owner on May 1, 2021. It is now read-only.
This repository was archived by the owner on May 1, 2021. It is now read-only.

Hookes not fired #9

@spoetnik

Description

@spoetnik

When creating a page in the api, the $wire->addHookBefore('Pages::saveReady', function($event) { } is not fired.

This is the code in my API:

`public static function addKite($data) {

RestApiHelper::checkAndSanitizeRequiredParameters($data, [
'title|string',
'body|string',
'brand|string',
]);

$title = $data->title;
$body = $data->body;
$brand = $data->brand;

// Create the kitepage
$kitePage = new Page();
$kitePage->template = 'kite';
$kitePage->parent = '/auctions';
$kitePage->of(false); // turns off output formatting

$kitePage->name = $title; // URL name
$kitePage->title = $title;
$kitePage->body = $body;
$kitePage->brand = $brand;

$kitePage->save();

return extractPageFields($kitePage, ['title', 'body', 'brand']);

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions