仅回滚:
Rolled back: 2015_05_15_195423_alter_table_web_directories
php artisan migrate:rollback,我的3个迁移正在回滚.
Rolled back: 2015_05_15_195423_alter_table_web_directories
Rolled back: 2015_05_13_135240_create_web_directories_table
Rolled back: 2015_05_13_134411_create_contacts_table
Run Code Online (Sandbox Code Playgroud)
无意中我web_directories和我的contacts桌子.可悲的是,我从来不希望这种情况发生,如果我只能回滚那个特定的那个,那么这场灾难将永远不会发生.
有人可以教我如何防止这种情况再次发生.
任何建议将不胜感激.
我使用Laravel 5.0在Mac OS Yosemite上.
在我的本地环境中,php artisan migrate我一直在运行:

组态
这是我的.env
APP_ENV=local
APP_DEBUG=true
APP_KEY=*****
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
Run Code Online (Sandbox Code Playgroud)
应用程序\ CONFIG\database.php中
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'homestead'),
'username' => env('DB_USERNAME', 'homestead'),
'password' => env('DB_PASSWORD', 'secret'),
'unix_socket' => '/tmp/mysql.sock',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
]
Run Code Online (Sandbox Code Playgroud)
我该如何避免这种错误?
我试过了 :
在app/database.php中
替换localhost为127.0.0.1
'host'=> env('DB_HOST', 'localhost') - >'host' => env('DB_HOST', '127.0.0.1') …
我有一个纬度和经度:"-27.0000,133.0000".我希望根据它制作一个地图.
我试过去看看这个链接
https://maps.googleapis.com/maps/api/geocode/json?latlng=-27.0000,133.0000&key=******
我一直在浏览器上收到此错误
{
"error_message" : "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console",
"results" : [],
"status" : "REQUEST_DENIED"
}
Run Code Online (Sandbox Code Playgroud)
但我想我已经启用了这个API.我登录到我的Google控制台,然后仔细检查.
当我去: https://console.developers.google.com/project/75423435770063/apiui/apis/enabled
我知道了 :
启用地理编码+地理定位.
我现在有点卡住了.我在这里错过了什么吗?
我跑了 git branch -a
* master
remotes/origin/test
remotes/origin/master
Run Code Online (Sandbox Code Playgroud)
我想删除我的远程分支
我试过了
git push origin --delete remotes/origin/test
Run Code Online (Sandbox Code Playgroud)
我有
错误:无法删除'remotes/origin/test':远程引用不存在
它怎么不存在?
我做了一个git branch -a,我看到它列出来了.
我错过了什么吗?
我有一个按钮
当我点击复制时
copyImageLinkText({ mouseenter, mouseleave }, e) {
this.showCopiedText = !this.showCopiedText
navigator.clipboard.writeText(this.imageLink)
clearTimeout(this._timerId)
mouseenter(e)
this._timerId = setTimeout(() => mouseleave(e), 1000)
},
Run Code Online (Sandbox Code Playgroud)
这条线似乎在我的 MacBook Pro 上本地运行得很好
navigator.clipboard.writeText(this.imageLink)
Run Code Online (Sandbox Code Playgroud)
当我构建并将其部署到我的开发服务器时,它不起作用。
类型错误:无法读取未定义的属性(读取“writeText”)
当我运行时,composer update我收到一些有线输出.

这是我的composer.json看起来像.
{
"name": "laravel/laravel",
"description": "The Laravel Framework.", "keywords": ["framework", "laravel"],
"license": "MIT",
"repositories": [{
"type": "vcs",
"url": "https://github.com/Zizaco/ardent.git"
}],
"require-dev": {
"phpunit/phpunit": "4.3.*"
},
"require": {
"laravel/framework": "4.2.*",
"laravelbook/ardent": "dev-master as 2.4.0",
"zizaco/entrust": "dev-master",
"sebklaus/profiler": "dev-master",
"doctrine/dbal": "dev-master"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations", "app/database/seeds", "app/tests",
"app/libraries"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php …Run Code Online (Sandbox Code Playgroud) 我正在使用Xcode 9我在加载应用程序时遇到此错误
libMobileGestalt MobileGestalt.c:890:此平台不支持MGIsDeviceOneOfType.
怎么阻止?
我有一个网址: http://localhost:8888/projects/oop/2
我想访问第一段 - > projects
我试过了
<?php echo $segment1 = Request::segment(1); ?>
刷新页面时,我的视图中看不到任何内容.
任何帮助/建议将不胜感激
描述:我有一个充满测试数据的表.有时,我想清除它以获取新数据.我可以像DB WorkBench一样在DBMS应用程序中执行截断,但我正在尝试在我的应用程序中实现它.
目标:在单击时创建一个按钮以截断数据库中的表.
这是我的步骤:
1 - 申报路线
Route::delete('visitor/truncate',array('as'=>'visitor.truncate', 'uses'=>'VisitorController@truncate'));
Run Code Online (Sandbox Code Playgroud)
2 - truncate在我的中创建一个函数VisitorController
public function truncate()
{
$visitors = Visitor::all();
$visitors ->truncate();
return View::make('visitors.index')
->with('success', 'Truncate Done');
}
Run Code Online (Sandbox Code Playgroud)
3 - 在我的视图上创建一个按钮
{!! Form::model($visitors, array( 'route' => array('visitor.truncate'),'method' => 'DELETE')) !!}
<button type="submit" class="btn bgm-red btn-float waves-effect waves-effect waves-button waves-float"><i class="md md-remove"></i></button>
{!! Form::close()!!}
Run Code Online (Sandbox Code Playgroud)
4 - 测试
当我点击它时,它进入truncate()我的控制器中的功能,但我不断收到此错误
调用未定义的方法Illuminate\Database\Eloquent\Collection :: truncate()
我需要包含任何东西truncate()吗?
任何提示将非常感谢!
我使用名为AlignTab的 Sublime Text 3插件来对齐我的代码,如下所示:
Version : 1.4.1
Author : Ken Wheeler
Website : http://kenwheeler.github.io
Docs : http://kenwheeler.github.io/slick
Repo : http://github.com/kenwheeler/slick
Issues : http://github.com/kenwheeler/slick/issues
Run Code Online (Sandbox Code Playgroud)
现在,我希望我的文本像这样留在冒号旁边:
Version: 1.4.1
Author: Ken Wheeler
Website: http://kenwheeler.github.io
Docs: http://kenwheeler.github.io/slick
Repo: http://github.com/kenwheeler/slick
Issues: http://github.com/kenwheeler/slick/issues
Run Code Online (Sandbox Code Playgroud)
我该如何做到这一点?
laravel ×5
laravel-5 ×4
php ×3
laravel-4 ×2
blade ×1
composer-php ×1
copy-paste ×1
eloquent ×1
geocoding ×1
git ×1
google-maps ×1
homestead ×1
ios ×1
javascript ×1
sublimetext ×1
sublimetext3 ×1
swift ×1
vue.js ×1
vuejs2 ×1
xcode ×1