Create Your Own Plugin

Create Your Own Plugin

Laraship QuestionsCategory: issues & BugsCreate Your Own Plugin
Gelber Orlando Moran Silva asked 3 weeks ago

Hi, I have this downside customizing the foo, I created it as advertised in the documentation.

create a new class named Canver and method getFeaturedCanver(), assign namespace in all files

namespace Corals\Modules\Foo\Classes;
namespace Corals\Modules\Foo\Models;
namespace Corals\Modules\Foo\Http\Controllers;

when I add new classes and modules I get this error

I want to make a query from the blades

@php $ canver = \ Canver :: getFeaturedCanver(); @endphp

Class not found


How do I fix this class not found error?


Staff replied 3 weeks ago


is this a custom made theme ?

Gelber Orlando Moran Silva
replied 3 weeks ago

yes, it is a custom theme and I have updated composer with the command, composer dump-autoload
as this blog explains.

I have made these passes so that it loads the classes automatically.

as this blog also explains

I don’t find a solution 🙁

1 Answers
laraship Staff answered 3 weeks ago
In order to be able to call a class statically, you need to attach a facade to your class,
you will find many examples inside Laraship how to use Facade

70% OFF

No Minimum, No Exceptions