Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ramchild1998's avatar

Unable to call component method. Public method [createPermission] not found on component

I experienced problems in the Livewire project when I wanted to implement the createPermission feature in the Laravel 11 Livewire 3 component.

app/Livewire/CreatePermission.php

<?php

namespace App\Livewire;

use Livewire\Component;
use Spatie\Permission\Models\Permission;

class CreatePermission extends Component
{
    public $name;

    public function createPermission()
    {
        $validatedData = $this->validate([
            'name' => 'required|string|max:255|unique:permissions,name',
        ]);

        Permission::create($validatedData);

        session()->flash('message', 'Permission created successfully.');
    }

    public function render()
    {
        return view('livewire.create-permission');
    }
}

Error : Internal Server Error Livewire\Exceptions\MethodNotFoundException Unable to call component method. Public method [createPermission] not found on component.

I have tried many times to make the component very simple for initial implementation before I make modifications.

Give me help from all of you who know whether there is an error in the code I created?

0 likes
1 reply
tykus's avatar

Show us where you are using the createPermission method; all we see for now is the Component class, which tells us nothing about how you use it... You could be calling the method on an instance of a completely different class!

Please or to participate in this conversation.