Last active
September 13, 2021 03:21
-
-
Save RobyCigar/d2860bb125d28d77a7b10abf305f9375 to your computer and use it in GitHub Desktop.
Adding and delete a single data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php artisan tinker | |
Psy Shell v0.10.3 (PHP 7.3.17-1+ubuntu16.04.1+deb.sury.org+1 — cli) by Justin Hileman | |
Add Data | |
>>> $test = new \App\Models\Project(); | |
=> App\Project {#3083} | |
>>> $test->name = "Test Project"; | |
=> "Test Project" | |
>>> $test->save(); | |
=> true | |
Delete | |
>>> $test->delete(); | |
=> true | |
Restore | |
>>> $test->restore() | |
=> true | |
>>> $test->forceDelete(); | |
=> true | |
/* mysql date format */ | |
$lastupdated = date('Y-m-d H:i:s'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment