M
M
Mikhail Dudkin2017-08-18 00:33:09
Laravel
Mikhail Dudkin, 2017-08-18 00:33:09

How to change external package in Laravel?

In general, there is an external package with an admin panel in which there is a Crud controller, it looks like this:
namespace Serverfireteam\Panel;
//use Illuminate\Routing\Controller; [remove this]
use App\Http\Controllers\Controller; [replace with this]
class CrudController extends Controller{
}
from CrudController inherit controllers from App/Http/Controllers.
In general, I only need to replace 1 line. How can this be done without pain? Well, or even how to copy the entire package to App/ and connect it? Laravel 5.2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D3lphi, 2017-08-18
@D3lphi

In general, what you want to do is contrary to the open-closed principle (S O LID). He says that the code should be closed for modification and open for extension.
In this regard, the question: "Do you need it?". Think, maybe the problem can be solved by inheriting from this class?
Bad idea. As a result, all packages that this package depends on will need to be kept under the same version. For, if something changes after the dependency update, the admin package may stop working correctly. Yes, and it's inconvenient.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question