I dont speak the language, but install it using composer and follow the guide?
How do I integrate a php library not written for Laravel into Laravel?
How do I integrate a php library not written for Laravel into Laravel?
The api I want to use -> https://github.com/Hasokeyk/instagram/blob/main/README-TR.md
@Sinnbeck https://github.com/Hasokeyk/instagram This library is written for php. I have read the information given, but since this is written for php, the location of the files is different in laravel.
@ErsinJuise Why? They are just in the vendor folder? Laravel is php.
@Sinnbeck Yes they are in the vendor folder.
@ErsinJuise Exactly. Same as laravels framework. So in a controller for instance. You add this to the top
use Hasokeyk\Instagram\Instagram;
and the method
public function foo()
{
$username = 'username';
$password = 'password';
$instagram = new Instagram($username,$password);
$login = $instagram->login->login();
if($login){
return 'Login success';
}else{
return 'Login Fail';
}
}
@Sinnbeck class not found error, I tried this.
@Sinnbeck I installed it without any problems, yes, but I get the error "hasokeyk/instagram/instagram class not found". But when I look there is an existing folder there.
@ErsinJuise And you ran the require command from the root of your laravel project?
Can you show your controller file?
namespace App\Http\Controllers; use App; use Hasokeyk\Instagram\Instagram;
class indexController extends Controller { public function instagram(){ return view('front.instagram'); } }
@ersinjuise Then read the README you’ve linked to. It has installation instructions, and then examples of usage.
@martinbean I have read the instructions but I am getting an error because the files have been moved in laravel.
@ersinjuise What do you mean, moved? It’s a package. You install it with Composer, you then use it as per the README.
Laravel is just PHP. There’s nothing “Laravel specific” about using that package.
Please or to participate in this conversation.