Find 5f73880b6233ee05e0fbc5a7e6227a74b5c63718.php in storage\frameworks\views and look at line 255
Whoops, looks like something went wrong.
2/2 ErrorException in 8d12b26c4e0e6750fc7366fec9007b0eb8f6414c.php line 176: Trying to get property of non-object (View: /var/www/thegameclub/resources/views/csgo/roomviewcreator.blade.php) in 8d12b26c4e0e6750fc7366fec9007b0eb8f6414c.php line 176 at CompilerEngine->handleViewException(object(ErrorException), '1') in PhpEngine.php line 44 at PhpEngine->evaluatePath('/var/www/thegameclub/storage/framework/views/8d12b26c4e0e6750fc7366fec9007b0eb8f6414c.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'id' => '33', 'name' => 'test', 'date' => '2016-07-06 13:19:00', 'map' => 'de_dust2', 'result' => '-1', 'players' => '2', 'rate' => '20', 'type' => '1', 'rounds' => '1', 'fullness' => '1', 'password' => '', 'creator_id' => '12')) in CompilerEngine.php line 59 at CompilerEngine->get('/var/www/thegameclub/resources/views/csgo/roomviewcreator.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'id' => '33', 'name' => 'test', 'date' => '2016-07-06 13:19:00', 'map' => 'de_dust2', 'result' => '-1', 'players' => '2', 'rate' => '20', 'type' => '1', 'rounds' => '1', 'fullness' => '1', 'password' => '', 'creator_id' => '12')) in View.php line 149
1/2 ErrorException in 8d12b26c4e0e6750fc7366fec9007b0eb8f6414c.php line 176: Trying to get property of non-object in 8d12b26c4e0e6750fc7366fec9007b0eb8f6414c.php line 176 at HandleExceptions->handleError('8', 'Trying to get property of non-object', '/var/www/thegameclub/storage/framework/views/8d12b26c4e0e6750fc7366fec9007b0eb8f6414c.php', '176', array('__path' => '/var/www/thegameclub/storage/framework/views/8d12b26c4e0e6750fc7366fec9007b0eb8f6414c.php', '__data' => array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'id' => '33', 'name' => 'test', 'date' => '2016-07-06 13:19:00', 'map' => 'de_dust2', 'result' => '-1', 'players' => '2', 'rate' => '20', 'type' => '1', 'rounds' => '1', 'fullness' => '1', 'password' => '', 'creator_id' => '12'), 'obLevel' => '1', '__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'id' => '33', 'name' => 'test', 'date' => '2016-07-06 13:19:00', 'map' => 'de_dust2', 'result' => '-1', 'players' => '2', 'rate' => '20', 'type' => '1', 'rounds' => '1', 'fullness' => '1', 'password' => '', 'creator_id' => '12')) in 8d12b26c4e0e6750fc7366fec9007b0eb8f6414c.php line 176 at include('/var/www/thegameclub/storage/framework/views/8d12b26c4e0e6750fc7366fec9007b0eb8f6414c.php') in PhpEngine.php line 42
My function in 8d12b26c4e0e6750fc7366fec9007b0eb8f6414c.php file.
function game() {
if (readygamecheck) {
$.ajax({
type: "GET",
line 176--> url: "/path1/" + '<?php echo e(Auth::user()->id); ?>',
success: function (data) {
if (data == 1) {
readygamecheck = false;
$.ajax({
type: "GET",
url: "/path2/" + '<?php echo e(Auth::user()->id); ?>',
success: function (data) {
start('block');
var windowserv = document.getElementById('window');
while(windowserv.childNodes[0]){
windowserv.removeChild(windowserv.childNodes[0]);
}
$('#window').append(data);
clearInterval(intervalReadeGame);
}
});
}
}
});
}
}
looks like the Auth::user() is null when you're trying to retrieve the id on the template.
open config/session.php and change 'domain' to null and try if it works.
This value has already been installed and at the same time there is a mistake that I have described. Help me please.
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => null,
After I tried to change the domain in the session file , I had here , this error when sending the form by post:
Whoops, looks like something went wrong.
1/1 TokenMismatchException in VerifyCsrfToken.php line 67: in VerifyCsrfToken.php line 67 at VerifyCsrfToken->handle(object(Request), object(Closure)) at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request))
Of course I use the desired tokens:
<input type="hidden" name="_token" value="{{ csrf_token() }}">
I found a solution:
This answer is for all the people who have already used {{ csrf_field() }} after the <form> tag in their view.blade.php file and have also run the php artisan key:generate command but are still getting the Token Mismatch error. These are the steps I took to resolve the TokenMismatchException error for one of my projects that was still in development.
Delete cache files from the following two folders within your laravel project:
storage/framework/sessions/
storage/framework/views/
After removing the cache files, clear your browser cache.
And everyone who uses {{Auth::user()->somefield}} everyone must check the authentication site visitors, for example:
<script>
var auth = 0;
@if({{Auth::check()}})
var auth = '{{Auth::user()->name}}';
@endif
</script>
And then problem will disappear.
It's mean that web-programmer shouldn't do something like:
<script>
alert('{{Auth::user()->id}}');
</script>
//Just for example..
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community