How to create query

  • Hello guys, where is the problem :sleeping:



    Code
    1.     $category = Category::create([
    2. 'title' => 'Yunus',
    3. 'create' => new \DateTime("now"),
    4. 'modified'=> new \DateTime("now"),
    5. 'user_id' => 1,
    6. 'color' => '#fff',
    7. 'status' => 1
    8. ]);
    9. $category->save();

    This Problem

    Code
    1. 3/3
    2. SyntaxErrorException in AbstractMySQLDriver.php line 90:
    3. An exception occurred while executing 'INSERT INTO pk_calendar_category (id, title, create, modified, user_id, color, status) VALUES (?, ?, ?, ?, ?, ?, ?)' with params [null, "Yunus", "2018-05-11 11:44:20", "2018-05-11 11:44:20", 1, "#fff", 1]:
    4. SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create, modified, user_id, color, status) VALUES (NULL, 'Yunus', '2018-05-11 11:' at line 1

    Hello guys, My name is Yunus. I'm back-end developer. İf you have a problem. You could tell me but my speaking too bad. So I not understand you. I'm sorry about this. I using google translate but even so it isn't enough. So that you should be patience. Thank you

  • Hm, I guess create is a reserved word. You should try to rename that to created.

    Ahhh. proper noun :D Thank you. What application do you use for the editor? Atom ? Phpstorm? Does Pagekit have crud in the command line

    Hello guys, My name is Yunus. I'm back-end developer. İf you have a problem. You could tell me but my speaking too bad. So I not understand you. I'm sorry about this. I using google translate but even so it isn't enough. So that you should be patience. Thank you

  • Hi :)

    I am using PHPStorm.

    Does phpStorm have a pagekit plugin? Are you creating the Model Class manually? You do not write this command

    Hello guys, My name is Yunus. I'm back-end developer. İf you have a problem. You could tell me but my speaking too bad. So I not understand you. I'm sorry about this. I using google translate but even so it isn't enough. So that you should be patience. Thank you