The blade not calling a function in the component
13:26 09 Oct 2025

I have a modal within a blade view (criteria.blade.php) and I want this modal when triggered and filled to call the function with a component (Criteria.php) which sends data to the database.

However, the function saveCriteria() is not being called and unfortunately the database is not being populated with the new data.

criterias.blade.php

Add Criteria Add New Criteria for Assessment
@error('criteria')

{{ $message }}

@enderror @error('marks')

{{ $message }}

@enderror
Add Criteria

Criterias.php

namespace App\Livewire\Admin;
    
use Livewire\Component; use App\Models\AssessmentCategory;
    
class Criterias extends Component
{
    public $criterias;
    
    public function render()
    {
        return view('livewire.admin.criterias');
    }

    public function mount()
    {
      $this->criterias=AssessmentCategory::all();     
    }
    
    public $criteria;
    
    public $marks;
    
    public function saveCriteria()
    {
        $validated=$this->validate([
            'criteria'=>'required|max:255',
            'marks'=>'required|max:2',        
        ]);
     
        AssessmentCategory::create($validated);
        $this->reset();
    }
}
laravel laravel-blade laravel-livewire livewire-3 laravel-livewire-wiremodel