jeudi 27 juillet 2017

Laravel - Class 'App\Http\Controllers\Object' not found

I am currently trying to figure out why I get this error:

FatalThrowableError: Class 'App\Http\Controllers\Object' not found in Operators.php line 23

This is the Operators.php controller from where the error is coming from:

public function getOperatorData()
{
    $api = new Client([
    'base_uri' => 'http://ift.tt/1xKO7iR',
    'cookies' => true, 
    ]); $api->post('ajaxauth/login', [
      'form_params' => [
         'identity' => '#', 
         'password' => '#', 
     ],
    ]);
    $response = $api->get('basicspacedata/query/class/satcat/orderby/INTLDES%20desc/limit/1/metadata/false');
    $mydata = json_decode($response->getBody()->getContents());
    $object = new Object();
    $object->intldes = $mydata->INTLDES;
    $object->satname = $mydata->SATNAME;
    $object->save();
    return view('pages/satellite-database', compact('object'));
}

The specific line from where the error comes from is:

$object = new Object();

The line shown above should be creating a new model for querying.

I am usually able to solve these (either I forgot the 'use' or something), but I have been unable to solve this error.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire