Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SimonAngatia's avatar

How do I install and configure a php non-laravel package from Github?

I want to use this https://github.com/pear2/Net_RouterOS package in my Laravel project but it is not a Laravel package but a PHP package. Though I have some information on how I can install it from this GitHub question: https://stackoverflow.com/questions/38323965/installing-github-package-into-laravel-project-using-composer , I have no idea how I can configure it to be used in Laravel Controllers and also helper functions files. Could anyone help me with this?

0 likes
3 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Laravel does not care that it isnt laravel related

  1. Install package using composer (ignore all the other methods)
  2. Put this inside a controller to try it out
try {
    $client = new RouterOS\Client('192.168.88.1', 'admin', 'password');
    return 'OK'; //is echo in example
} catch (Exception $e) {
    die($e);
}
Snapey's avatar

bear in mind that this package has not been updated since 2017 so the chances of there being issues with php7.4 and 8.x are high

You may need to explore the forks of the package to see if anyone has updated it

1 like

Please or to participate in this conversation.