Laravel Model reference inside Controller gives error while hosted on Heroku - laravel

I have build a Lingo game in Laravel. The app is hosted on Heroku: https://lingo-hu.herokuapp.com.
Whenever I click the 'Start Game'-button it should send a HTTP-POST-REQUEST to my WordController. After doing so it gives the following response:
"message": "Attempt to read property \"word\" on null",
"exception": "ErrorException",
"file": "/app/app/Http/Controllers/WordController.php",
"line": 23,
My WordController reference to the 'word'-model:
namespace App\Http\Controllers;
use App\word;
use App\game;
use Illuminate\Contracts\Routing\ResponseFactory;
use Illuminate\Http\Request;
class WordController extends Controller
{
}
However this action does work on my computer when running Laravel locally, just not on Heroku which I don't understand.
Console error:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
app.js:699 Uncaught (in promise) Error: Request failed with status code 500
at createError (app.js:699)
at settle (app.js:960)
at XMLHttpRequest.handleLoad (app.js:168)
The database is up and running, I used php artisan migrate and that's working.
Anyone a suggestion on what I could be doing wrong?

The error was caused because the database table where the Word model was referring to was empty. So I imported an export from my MySQL database. Now it works!

Related

500 Internal Server Error in Laravel query error when i die dump the data appears but the console show ther error

$shipments =DB::table('users')
->select('users.fname')
// ->where('invnum.doctype','=',5)
// ->where('invnum.docstate','=',4)
->get();
dd($shipments);
i have an issue with my laravel application which just started abruptly am getting the below error
The data is displays in dd but when i have a query with a lot of data it doesn't and am getting the error i have tried to add cors but the error doent go away what could be the issue the laravel logs shows no error. I understand 500 is not an actual error but the server could not find appropriate response

facing error in paystack integrattion in laravel 8

Hi I'm trying to integrate paystack in laravel 8 but I'm click paynow button it give following error
Client error: POST https://api.paystack.co/transaction/initialize resulted in a 404 Not Found response:
{
"status": false,
"message": "Invalid Split code."
}
anyone can help how can i solve this
thanks
Can you share the request body? It looks like you're trying to pass a split code when you're initializing the transaction, but the code you're passing either:
Doesn't exist on that integration
Exists on the integration but maybe in test mode, and you're using your live keys (or in live mode and you're using your test keys)

Laravel custom artisan command cannot access model

I'm trying to create a artisan command to dump data from database table in my existing Laravel 6 project.
I'm following the web to create the command, it works and prints out.
https://codeinphp.github.io/post/creating-your-own-artisan-in-php/
However I could not access the model in the existing project.
I've tried using
MyModel::all()
but it returns error about connection
PHP Fatal error: Uncaught Error: Call to a member function
connection() on null
I also tried do the data dump using existing getCsv() from controller, like
app('App\Http\Controllers\MyController')->getCsv();
Then it complains
Class request does not exist
I also tired doing
$table = DB::table('my_table');
But error returns as
A facade root has not been set

Blade engine works local but not on the live server

My laravel 5.5 project works fantastic on wamp local server and doesn't have problem with BLADE templating.
but when I serve it on live server the BLADE template doesn't work properly and debug mode shows :
{
"message": "Undefined variable: user (View: /home/cafegamesepanta/laravel/resources/views/child.blade.php)",
"exception": "ErrorException",
"file": "/home/cafegamesepanta/laravel/storage/framework/views/4e1f0e4c5be0294bbdada500a5c395626107f4d8.php",
"line": 2,
"trace": [
//
notice that I just changed permissions of /strorage folder!
anyone can help? thanks
Clear all files in laravel/storage/framework/views.
Check that your controller has passed the User variable to views.
Check your database connection.

Magento Bug In Mage_Paypal_Model_Ipn

I am using Magento Community 1.5.0.1 and when I receive a PayPal IPN message to /paypal/ipn, the transaction information in coming in successfully, and the order is automatically moved to paid and a invoice is generated.
However, in my PHP logs I get this message:
[28-Jul-2011 06:42:36] PHP Fatal error: Call to a member function getIncrementId() on a non-object in /app/code/core/Mage/Paypal/Model/Ipn.php on line 390
[28-Jul-2011 06:42:36] PHP Fatal error: Class 'Mage' not found in /app/code/core/Mage/Core/Model/Mysql4/Session.php on line 0
Also, a email is sent to our admin email (since I have it enabled to have invoices sent to us), however, a email is not sent to the customer.
I imagine these are related.
Any ideas on how to fix this? It makes no sense for a error to be returned since when I echo $creditmemo->getIncrementId(); just before the line causing the error, the ID is clearly being returned!
This is bad because as a fatal error, it
Obviously it is not a good idea to modify core files, but see if it works by changing the following line:
if ($invoice = $payment->getCreatedInvoice() && !$this->_order->getEmailSent()) {
to the following:
if (($invoice = $payment->getCreatedInvoice()) && !$this->_order->getEmailSent()) {

Resources