Laravel webfox/laravel-xero-oauth2 getting Class "App\Models\XeroAPI\XeroPHP\Models\Accounting\Invoice" not found - laravel

So I have installed the webfox/laravel-xero-oauth2 extension via composer and configured my xeroController and the webhook controller as defined in the docs for this (https://github.com/webfox/laravel-xero-oauth2) the connection works and I am able to show that Xero is connected.
I then started work on submitting an invoice and as per the last part of the docs i opened the link (https://github.com/XeroAPI/xero-php-oauth2-app/blob/master/example.php). To facilitate this I used a working non Laravel invoice app from inhouse and progressed well but when i run this on an environment where I can connect to Xero (I am using a staging site here rather than configuring ngrok or some such thing) and i get the error above. The code where this error has happened is as follows:
$xero = resolve(\XeroAPI\XeroPHP\Api\AccountingApi::class);
$xeroTenantId = $xeroCredentials->getTenantId();
$type = XeroAPI\XeroPHP\Models\Accounting\Invoice::TYPE_ACCREC;
$client = $this->client();
Now I searched in the api and found the reference to this in my projects vendor folder vendor/xeroapi/xero-php-oauth2/lib/Models/Accounting/Invoice.php on line 361 it is shown const TYPE_ACCREC = 'ACCREC'; So It seems I'm not referencing this correctly? On the inhouse this is being found with no issue (although the folder structure is not the same as in Laravel so not sure how helpful this is but it is in it's vendor folder and following the exact same path).
What have I missed? I use phpStorm and it is saying that this is an undefined namespace. I have also this message on the line where we connect to Xero but a dd has verified that this works, the error is shown after this line too. I have ran composer dump-autoload and I have also cleared out all caches to rule this out but same error.

Related

Install Laravel on Sub Domain has Http 500 error

Having some real problems installing a Laravel App on a Bluehost[ed] subdomain. I get a 500 error and checked a number of web-resources and tutorials.
Here's what I've tried:
A) A simple FTP of the MyGreatApp to the main domain root, copying the MyGreatApp public folder in the public_html/subDomainName/ as suggested by "Deploy Laravel To Shared Hosting The Easy Way" (but with sub domain thoughts) https://www.youtube.com/watch?v=6g8G3YQtQt4
But I get a http 500 error.
B) A similar method using SSH and cloning a git repository which contains the Laravel boiler plate.
In each case the boilerplate Laravel app doesn't run. I can echo out of the index.php to let me know what I get to in the PHP.
Many tutorials suggest changing the paths (for subdomains) in the index.php file too as the public folder of the subdomain is buried differently to the public_html of the main domain.
We are using PHP 7.1 on bluehost and Laravel 7
Any thoughts to get a stage beyond the 500 error?
EDIT: The error is thrown after attempting to execute this part of the code...
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
Delete everything (backup the important files, I'm not responsible for any data loss)
Create folder laravelapp or whatever you want
Upload your laravel project to that folder
Create new subdomain and point to public_html/laravelapp/public
We figured it out. It related to a problem with the dev PHP environment and the prod. PHP environment. PHP(Dev) > PHP(Prod) and a version issue in Symfony. When we downgraded Symfony to the "right" level of PHP it's fine.

intervention-image with laravel 5.2 on ubuntu-server breaks the other calls

I am using laravel 5.2 to write services for a mobile app. all the calls are working fine. My project is deployed in ubuntu server.
Now I want to resize the uploaded images inorder to maintain same performance. I thought of trying intervention-image.
In local machine it worked fine. I installed intervention-image and set the provider and alias name, I included the alias name to controller. Once I do that and update the server, all the other calls are getting effected. I am getting 505 error.
It's the intervension-image which is causing this problem, I checked with previous upload and I am getting all the calls. Any suggestions?
I suggest you create a dev environment like your production , use vagrant . About error 505 check you error log file to have more detail about the bug

Laravel and Valet bizarre loading issue

Strange problem: Have installed Laravels 'Valet' to serve sites from .dev locally. When I am in my 'code' directory where I parked valet and create say laravel new blog installed perfectly and spins up on blog.dev. However say I create laravel new test and visit test.dev I get 404 - nothing found ...? I removed everything and tried again but the same thing happens. Has anyone else had the same problem?
UPDATE
Interestingly, from that same directory 'code' If i run a ping on blog.dev I get returned packets and pings. However I do the same on test, I get bunch of help commands?
FURTHER UPDATE
So inside the project 'test' if I run php artisan serve I get a response of Laravel development server started: <http://127.0.0.1:8000> and If I visit the path bingo it works. But that confuses the issue even further for me...?
EVEN FUTHER UPDATES
So, I wish to add this iMac was a previous developers so the home folder is called Adam, I am a seperate user but also an Admin with my own folder sat next to it called 'Dan'but not a 'home' directory as such it is just in the sames 'Users' directory whenever I try to do anything I get errors like: ERROR: Notice: Undefined index: domain in /Users/Adam/.composer/vendor/laravel/valet/cli/valet.php on line 55 That was when trying to spin up laravel share

codeigniter display error: Unable to locate the model you have specified:

I use latest version of CI, that is 2.1.2.
I upload my demo application in the following location http://www.domainname.com/myfolder/index.php
If i try to open home page, welcome controller is opened correctly. However if I try to open http://www.domainname.com/myfolder/index.php/controllername/functionname page, I get the following error message:
An Error Was Encountered
Unable to locate the model you have specified: backofficeusersmodel
In my config file, I have the following settings:
$config[‘base_url’] = ‘http://www.domainname/myfolder/’;
$config[‘index_page’] = ‘index.php’;
I also tried and
$config[‘base_url’] = ‘http://www.domainname.com/myfolder/application/’;
$config[‘index_page’] = ‘index.php’;
without any success.
However, the model is uploaded and its name is backOfficeUsersModel, not as stated in the error message all lover case.
I would like to mention that I use myModel (uploaded in application/core), and that same strange thing was happening when I upload same application under some free hosting, just there the error was that mymodel could not be located.
I upload same application on different hosting company and there it worked. Also, same application work normally on my localhost.
Anyone had similar experience?
Model files should be in application/models folder and should be named in lower case like backofficeusersmodel. Probably there is a deficiency in these requirements.

My website is throwing "PHP Fatal error: Call to undefined method CI_Lang::lang()"

I created a website using CodeIgniter Framework 2.1.0 that was originally working well. Yesterday, I integrated this i18n code into the site for multi-language support.
Now, when I upload my site to cpanel and open it, I get this error in my log file:
[21-Nov-2011 10:19:04] PHP Fatal error: Call to undefined method CI_Lang::lang() in XXXX
However, the website is working well on my localhost server (xampp for Windows). What's wrong?
See the thread attached to the library: http://web.archive.org/web/20120112092127/http://codeigniter.com/forums/viewthread/179036. In the first post is attached a modified library that claims to alleviate the buggyness of the original.
There is also a post on the first page there referencing an error similar to yours:
After copying the files as described in the article I get the
following error: Fatal error: Call to undefined method
CI_Lang::CI_Lang() in
/www/websites/audio-machinery/application/core/MY_Lang.php on line 32
Though he seems to be calling CI_Lang, not Lang. His solution appears to have been to use the code attached to the forum thread.
Also, cpanel is a control panel for hosting, not a hosting provider. But your hosting provider may be causing issues (e.g. if using older versions of PHP which do not work with newer version of CI. Often hosting providers will give you the ability to choose which version of PHP you are using--usually found in cPanel).
have you uploaded ALL the new files to your live server? that error implies that the code is not found or available to the script.
I came accross the same problem.... it was working fine on localhost but when loaded on live server it gives me undefined error... the problem appears becuase I created file with name My_Lang.php and My_Config.php as on live server it is case sensitive.... so I changed it to MY_Config.php and MY_Lang.php .... it works fine now.... Hope it will work for you too

Resources