Skip to content

Instantly share code, notes, and snippets.

@RobyCigar
Last active September 13, 2021 03:21
Show Gist options
  • Save RobyCigar/d2860bb125d28d77a7b10abf305f9375 to your computer and use it in GitHub Desktop.
Save RobyCigar/d2860bb125d28d77a7b10abf305f9375 to your computer and use it in GitHub Desktop.
Adding and delete a single data
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