Laravel 5.7 checking code in tinker, but i have a problem while getting values from model class? [duplicate]












-1
















This question already has an answer here:




  • Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE

    5 answers




my question is totaly different from that question, in that question they are telling about php versions and all, that question didn't solved my issue, thats why I haved asked my own question. @Álvaro González



I have created 4 models with this command



php artisan make:model class
php artisan make:model student
php artisan make:model subject
php artisan make:model user


I have created migrations and everything, but the problem is when I test my models in php artisan tinker with this command Appstudent::all(); then subject user and student models are working and shows me data but Appclass::all(); is not working and showing me this error



PHP Parse error, Unexpected T_CLASS, Expecting T_STRING



I have also migration for class and also data is present in class table in database, but I don't know why it's not working, Any help would be appreciated Thanks










share|improve this question















marked as duplicate by Álvaro González php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 8:25


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • 2





    class is a reserved keyword, rename it to something else. secure.php.net/manual/en/reserved.keywords.php

    – kerbholz
    Nov 21 '18 at 8:22













  • I was thinking that as i uploaded question, let me try this

    – Akhtar Munir
    Nov 21 '18 at 8:23
















-1
















This question already has an answer here:




  • Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE

    5 answers




my question is totaly different from that question, in that question they are telling about php versions and all, that question didn't solved my issue, thats why I haved asked my own question. @Álvaro González



I have created 4 models with this command



php artisan make:model class
php artisan make:model student
php artisan make:model subject
php artisan make:model user


I have created migrations and everything, but the problem is when I test my models in php artisan tinker with this command Appstudent::all(); then subject user and student models are working and shows me data but Appclass::all(); is not working and showing me this error



PHP Parse error, Unexpected T_CLASS, Expecting T_STRING



I have also migration for class and also data is present in class table in database, but I don't know why it's not working, Any help would be appreciated Thanks










share|improve this question















marked as duplicate by Álvaro González php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 8:25


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • 2





    class is a reserved keyword, rename it to something else. secure.php.net/manual/en/reserved.keywords.php

    – kerbholz
    Nov 21 '18 at 8:22













  • I was thinking that as i uploaded question, let me try this

    – Akhtar Munir
    Nov 21 '18 at 8:23














-1












-1








-1









This question already has an answer here:




  • Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE

    5 answers




my question is totaly different from that question, in that question they are telling about php versions and all, that question didn't solved my issue, thats why I haved asked my own question. @Álvaro González



I have created 4 models with this command



php artisan make:model class
php artisan make:model student
php artisan make:model subject
php artisan make:model user


I have created migrations and everything, but the problem is when I test my models in php artisan tinker with this command Appstudent::all(); then subject user and student models are working and shows me data but Appclass::all(); is not working and showing me this error



PHP Parse error, Unexpected T_CLASS, Expecting T_STRING



I have also migration for class and also data is present in class table in database, but I don't know why it's not working, Any help would be appreciated Thanks










share|improve this question

















This question already has an answer here:




  • Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE

    5 answers




my question is totaly different from that question, in that question they are telling about php versions and all, that question didn't solved my issue, thats why I haved asked my own question. @Álvaro González



I have created 4 models with this command



php artisan make:model class
php artisan make:model student
php artisan make:model subject
php artisan make:model user


I have created migrations and everything, but the problem is when I test my models in php artisan tinker with this command Appstudent::all(); then subject user and student models are working and shows me data but Appclass::all(); is not working and showing me this error



PHP Parse error, Unexpected T_CLASS, Expecting T_STRING



I have also migration for class and also data is present in class table in database, but I don't know why it's not working, Any help would be appreciated Thanks





This question already has an answer here:




  • Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE

    5 answers








laravel-5.7






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 8:50







Akhtar Munir

















asked Nov 21 '18 at 8:18









Akhtar MunirAkhtar Munir

6612




6612




marked as duplicate by Álvaro González php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 8:25


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Álvaro González php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 8:25


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 2





    class is a reserved keyword, rename it to something else. secure.php.net/manual/en/reserved.keywords.php

    – kerbholz
    Nov 21 '18 at 8:22













  • I was thinking that as i uploaded question, let me try this

    – Akhtar Munir
    Nov 21 '18 at 8:23














  • 2





    class is a reserved keyword, rename it to something else. secure.php.net/manual/en/reserved.keywords.php

    – kerbholz
    Nov 21 '18 at 8:22













  • I was thinking that as i uploaded question, let me try this

    – Akhtar Munir
    Nov 21 '18 at 8:23








2




2





class is a reserved keyword, rename it to something else. secure.php.net/manual/en/reserved.keywords.php

– kerbholz
Nov 21 '18 at 8:22







class is a reserved keyword, rename it to something else. secure.php.net/manual/en/reserved.keywords.php

– kerbholz
Nov 21 '18 at 8:22















I was thinking that as i uploaded question, let me try this

– Akhtar Munir
Nov 21 '18 at 8:23





I was thinking that as i uploaded question, let me try this

– Akhtar Munir
Nov 21 '18 at 8:23












1 Answer
1






active

oldest

votes


















0














This model is invalid:



class class extends Model
{
//
}





share|improve this answer
























  • OP found that out already, that's why the question exists. A (short) explanation on why it is invalid would be nice and helpful.

    – kerbholz
    Nov 21 '18 at 8:25











  • Boom, just saw that! I thought the visual aid of class class told the story... way to knock my peep in the ground yo.

    – Justin Schwimmer
    Nov 21 '18 at 8:27




















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This model is invalid:



class class extends Model
{
//
}





share|improve this answer
























  • OP found that out already, that's why the question exists. A (short) explanation on why it is invalid would be nice and helpful.

    – kerbholz
    Nov 21 '18 at 8:25











  • Boom, just saw that! I thought the visual aid of class class told the story... way to knock my peep in the ground yo.

    – Justin Schwimmer
    Nov 21 '18 at 8:27


















0














This model is invalid:



class class extends Model
{
//
}





share|improve this answer
























  • OP found that out already, that's why the question exists. A (short) explanation on why it is invalid would be nice and helpful.

    – kerbholz
    Nov 21 '18 at 8:25











  • Boom, just saw that! I thought the visual aid of class class told the story... way to knock my peep in the ground yo.

    – Justin Schwimmer
    Nov 21 '18 at 8:27
















0












0








0







This model is invalid:



class class extends Model
{
//
}





share|improve this answer













This model is invalid:



class class extends Model
{
//
}






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 '18 at 8:24









Justin SchwimmerJustin Schwimmer

989




989













  • OP found that out already, that's why the question exists. A (short) explanation on why it is invalid would be nice and helpful.

    – kerbholz
    Nov 21 '18 at 8:25











  • Boom, just saw that! I thought the visual aid of class class told the story... way to knock my peep in the ground yo.

    – Justin Schwimmer
    Nov 21 '18 at 8:27





















  • OP found that out already, that's why the question exists. A (short) explanation on why it is invalid would be nice and helpful.

    – kerbholz
    Nov 21 '18 at 8:25











  • Boom, just saw that! I thought the visual aid of class class told the story... way to knock my peep in the ground yo.

    – Justin Schwimmer
    Nov 21 '18 at 8:27



















OP found that out already, that's why the question exists. A (short) explanation on why it is invalid would be nice and helpful.

– kerbholz
Nov 21 '18 at 8:25





OP found that out already, that's why the question exists. A (short) explanation on why it is invalid would be nice and helpful.

– kerbholz
Nov 21 '18 at 8:25













Boom, just saw that! I thought the visual aid of class class told the story... way to knock my peep in the ground yo.

– Justin Schwimmer
Nov 21 '18 at 8:27







Boom, just saw that! I thought the visual aid of class class told the story... way to knock my peep in the ground yo.

– Justin Schwimmer
Nov 21 '18 at 8:27







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini