Calling functions inside a model in the Blade View

Posted 5 months ago by gouseferoz

I was trying to call a function inside a model from the blade view.

<td>{{ App\ExamModules::modulename() }}</td>

I am seeing an error: Non-static method App\ExamModules::modulename() should not be called statically

This is my function on the model

public function modulename()
    {
        return "hello";
    }

Can anyone help what i am doing wrong here?

Thanks.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.