Support the ongoing development of Laravel.io →
posted 11 years ago
Configuration

Hi, i created new libraries folder and inside linkedin class.

//laravel/app/libraries/linkedin/linkedin.php

<?php namespace Linkedin; class Linkedin{ public function test() { $user = new UserModel(); } } UserModel class is in laravel/app/models. How can I use UserModel class in linkedin class? Class Here it the error 'Linkedin\UserModel' not found Probably I should use "use" ?
Last updated 3 years ago.
0

Hi valuk82

writing

use UserModel;

before your class will work.

Regards Alex

Last updated 3 years ago.
0

Thanks, it wokrs.

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.