Is it OK to write PHP function on Laravel Blade

Solution:

In my opinion, it depends on what the function do.

If this function is used only in a specific view, put this function inside that blade file is acceptable.

If this function do somethings that can be used in many places, you should move it to a php file and include it in start.php or use composer autoloading.