Exception raised while trying to access facebook API with CodeIgniter - php

I am trying with Facebook API with codeigniter. While I am trying with get some basic information about the users like
$this->facebook->api('/me?fields=id,name,link,email,user_hometown,user_education_history,user_birthday&perms=publish_stream,create_event');
I am getting exception like
Exception: Unknown fields: user_hometown,user_education_history,user_birthday
But the documentation says it is fine. Any thoughts?

You don't need the "user_" prefix on "hometown", "education", and "birthday". You also don't need "_history" on "education". Try this in your API call instead:
'me?fields=id,name,link,email,hometown,education,birthday'

Related

findOrFail Laravel 8 method not found

I am working on Laravel 8 , I have tried to use findOrFail method in order to set redirection to 404 error not found instead of displaying error but it is showing this error method findOrFail not found,
this is the line of code in ProfilesController that is causing the error
$user = User::findOrFail($user);
this is the output of the error
enter image description here
Thanks in advance,
Look like your code works fine. The issue Php Strom not able to identify methods.
I always use query() method to get autocomplete model methods
$user=User::query()->findOrFail($user);
or you might need to install any extension which can able to identify laravel methods

Laravel - Creating Custom Classes throws error of undefined

I've been following this short tutorial and wanted to make my own class and call it simple like classname::methodname, but without injection.
I get the following error:
exception 'Symfony\Component\Debug\Exception\FatalErrorException' with
message 'Call to undefined method
App\Facades\LiveSearch::getServiceList()'
Link to Tutorial: here
It makes sense and that is why i cannot figure out where the problem lies ..
Hey you also need to do the follow up steps to create laravel classes.
I hope this reference on How to create a laravel class is helpful.

Could not load type "Doctrine\DBAL\Types\StringType symfony

I am new to Symfony and am stuck with this error:
"Could not load type "Doctrine\DBAL\Types\StringType""
I haven't used any custom types and cannot find where the error comes from. I was trying to do a create action using a Symfony sample. I did like they said but this error appears when I want to try the result.
I found the problem. I got confused and should have used the Symfony\Component instead of the Doctrine\DBAL.
Thanks for the help.

Laravel 5 Custom Fatal Error Exception

I am building a web service in Laravel 5. However if there's a fatal error, Laravel always return the generic 'Whoops, looks like something went wrong' page.
How can change it to return JSON / XML instead?
Note
I know that you can put other exception in app\Exceptions\Handler.php but this doesn't work for Fatal Error Exception
I read for Laravel 4 you can do App::fatal(function(){...}) Is this still the valid way to do in Laravel 5? If yes where should I put it?
Thanks heaps

Fatal error: Call to undefined method Google_IO_Curl::authenticatedRequest()

When using the described in the Google Contacts API example simple.php, and the Google API PHP Client from GitHub, version 1.0.4-beta, I get the following error:
Fatal error: Call to undefined method Google_IO_Curl::authenticatedRequest()
However, when I change this line...
$val = $client_svc_contacts->getIo()->authenticatedRequest($req);
...to...
$val = $client_svc_contacts->getAuth()->authenticatedRequest($req);
...then it starts working again.
I am using version 1.0.4-beta unmodified except for the addition of the following line at the top of Client.php:
set_include_path(str_replace('/Google','',dirname(__FILE__)));
I recognize that simple.php was written for version 0.6, not v1+, but is the example just out of date compared to the version on GitHub? Or is there something wrong with my implementation?
Found a migration guide that had the answer ...
A new home for authenticatedRequest
The authenticatedRequest method has been moved from the io classes to
the auth classes.
So it appears that replacing getIo() with getAuth() was the correct course of action.

Categories