markdown 修补匠 - 数据库

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 修补匠 - 数据库相关的知识,希望对你有一定的参考价值。

## start tinker
`php artisan tinker` 


## create data (option 1)
`$post = App\Post::create(['title'=>'PHP post from tinker','content'=>'PHP content from tinker']);`  

## create data (option 2)
`$post = new App\Post`  
`$post`  
`$post->title = "New Title"`  
`$post->content = "Awesome!"`  
`$post`  
`$post->save();`  


## read/find data (option 1)
`$post = App\Post::find(3)`  

## read/find data (option 2)
`$post = App\Post::where('id', 2)->first();` 


## update data
`$post = App\Post::find(3)`  
`$post->title = 'updated record title with id 3'`  
`$post->save()`

## delete data (soft delete) 
`$post = App\Post::find(3)`   
`$post->delete()`  


## delete data (permanently)
`$post = App\Post::onlyTrashed()`  
`$post`  
`$post->forceDelete()`  

以上是关于markdown 修补匠 - 数据库的主要内容,如果未能解决你的问题,请参考以下文章

text 修补匠

text 寻找修补匠 - Laravel

text 重启Artisan修补匠

text 修补匠命令

NSIS:无法导入修补匠

Laravel - “工匠修补匠” - > mkdir():权限被拒绝