Laravel 5.4 'Route' (T_STRING), expecting ',' or ')' > Error - php

Can anyone tell me why I'm getting this error.
(1/1) FatalThrowableError
Parse error: syntax error, unexpected 'Route' (T_STRING), expecting ',' or ')'
in web.php (line 61)
Route screenshot
I didn't found any script error in my code. If anyone would help, that will be appreciated.
Thanks in advance.

For your groups you're writing
->group(function(){
//whatever
}
forgetting to close the group(),
For example on line 59 replace } with });
Turning it to
->group(function(){
//whatever
});

Related

FatalThrowableError bootstrap/cache/services.php Laravel

Sometimes I am getting Errors from bootstrap/cache/services.php Laravel 5.6
And I don't understand why I am getting them and how to fix.
{"message":"syntax error, unexpected end of file, expecting ')'","class":"Symfony\\Component\\Debug\\Exception\\FatalThrowableError","code":0,"file":"\/app\/bootstrap\/cache\/services.php:130","line":0,"trace":"\/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php:92; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php:55; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php:548; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Bootstrap\/RegisterProviders.php:17; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php:206; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Console\/Kernel.php:297; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Console\/Kernel.php:120; \/app\/artisan:35"}
or
{"message":"syntax error, unexpected ''command.queue.resta' (T_ENCAPSED_AND_WHITESPACE), expecting ')'","class":"Symfony\\Component\\Debug\\Exception\\FatalThrowableError","code":0,"file":"\/app\/bootstrap\/cache\/services.php:127","line":0,"trace":"\/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php:92; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php:55; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php:548; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Bootstrap\/RegisterProviders.php:17; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php:206; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Console\/Kernel.php:297; \/app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Console\/Kernel.php:120; \/app\/artisan:35"}

Trying to get property 'id' of non-object only in my website

Recently I updated my website and I found this error only in one view, on my localhost works fine, I uploaded it via FTP. I'm going crazy!
[2020-01-30 03:32:39] local.ERROR: Trying to get property 'id' of non-object (View: /home/csinf298/resources/views/addEdit_promotion.blade.php) {"userId":3,"email":"email#email.com.mx","exception":"[object] (ErrorException(code: 0): Trying to get property 'id' of non-object (View: /home/csinf298/resources/views/addEdit_promotion.blade.php) at /home/csinf298/storage/framework/views/a22f101b5a2d4fafaa9530cd13c1077aebc547ce.php:211, ErrorException(code: 0): Trying to get property 'id' of non-object at /home/csinf298/storage/framework/views/a22f101b5a2d4fafaa9530cd13c1077aebc547ce.php:211)
My.blade
$promotion->id
I tried this too
$promotion->['id']
[2020-01-30 03:58:27] local.ERROR: Parse error: syntax error, unexpected '[', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' (View: /home/csinf298/resources/views/addEdit_promotion.blade.php) {"userId":3,"email":"carlos.cisneros#csinformatica.com.mx","exception":"[object] (ErrorException(code: 0): Parse error: syntax error, unexpected '[', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' (View: /home/csinf298/resources/views/addEdit_promotion.blade.php) at /home/csinf298/storage/framework/views/a22f101b5a2d4fafaa9530cd13c1077aebc547ce.php:176, Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Parse error: syntax error, unexpected '[', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' at /home/csinf298/storage/framework/views/a22f101b5a2d4fafaa9530cd13c1077aebc547ce.php:176)
First of all, clear the caches with $promotion->id as using the below command.
php artisan config:cache
php artisan view:clear
php artisan route:clear
If you still get the error then use $promotion->userId as I have seen in your error the object contains userId, not an id.
Is your query returning array or object? If you dump it out, you might find that it's an array and all you need is an array access ([]) instead of an object access (->).
or
Try This
$promotion->id
to
$promotion->['id']
or
$promotion[0]->poster['id']
$promotion->poster[0]['id']
It happen that after some time we need to run
php artisan passport:install --force
again to generate a key this solved my problem ,
Trying to get property 'id' of non-object
as you can see , it says non-object so you need to check 1st it's array or object if it is object then check id property is present or not
and if it is array then
rather then $promotion->['id']
use this
$promotion['id']

Php how do i include # in variable

{
$myorganization->#type="Organization";//this point of view error
$myorganization->name="creative eyes";//this point of view error
}
whenever i save it on and run it shows
Parse error: syntax error, unexpected '#', expecting identifier
(T_STRING) or variable (T_VARIABLE) or '{' or '$' in
/srv/disk7/2375751/www/xyz.com/index.php on line 436
type is not variable in that instance, so you can't use it there.
You'd have to do: #$myorganization->type="Organization";//this point of view error

Unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR

I'm trying to run a WordPress plugin, and I get the following error:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION
or T_FUNCTION or T_VAR or '}' in
/nfs/c03/h05/mnt/52704/domains/creathive.net/html/wp-content/plugins/qr-code-tag/lib/qrct/QrctWp.php
on line 13
What would cause this error? Line 13 is the public bit.
EDIT: Here is some code:
class QrctWp
{
public $pluginName = 'QR Code Tag';
Running on PHP4 by any chance? That's what the error message at this location would usually indicate.
Remove all public and private attributes. Though it's unlikely the plugin will work perfectly with the older object instance handling.

PHP Bug? With Class?

Here is my code:
<?php class Video { protected $_test; } ?>
and when I try to include the file containing this code I've got that error:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in ../classes/Video.class.php on line 1
What's wrong? I don't understand.
This looks like you're still running PHP 4, which doesn't know the protected keyword.
An update to PHP 5 would be a good idea.

Categories