小编Gop*_*osa的帖子

在迁移层5.1中设置自动增量字段开始表单1000

我需要在用户表中从1000开始我的ID,我怎么能为此创建迁移.

我目前的迁移是:

public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->increments('id'); // how can I start this from 1000
        $table->integer('qualification_id')->nullable();
        $table->integer('experience_id')->nullable();
    });
}
Run Code Online (Sandbox Code Playgroud)

php mysql migration laravel-5.1

21
推荐指数
4
解决办法
2万
查看次数

检查邮件是否成功发送到Laravel 5

我有一个可以使用它在Laravel5上发送邮件的功能

/**
 *  Send Mail from Parts Specification Form
 */
 public function sendMail(Request $request) {
    $data = $request->all();

    $messageBody = $this->getMessageBody($data);

    Mail::raw($messageBody, function ($message) {
        $message->from('yourEmail@domain.com', 'Learning Laravel');
        $message->to('goper.zosa@gmail.com');
        $message->subject('Learning Laravel test email');
    });

    return redirect()->back();
 }

 /**
  * Return message body from Parts Specification Form
  * @param object $data
  * @return string
  */
 private function getMessageBody($data) {

    $messageBody = 'dummy dummy dummy dummy';
 }
Run Code Online (Sandbox Code Playgroud)

并成功发送.但是如何检查它是否被发送?喜欢

if (Mail::sent == 'error') {
 echo 'Mail not sent';
} else {
 echo 'Mail …
Run Code Online (Sandbox Code Playgroud)

smtp sendmail laravel laravel-5

12
推荐指数
3
解决办法
4万
查看次数

如何在CKEDITOR中动态插入文本

我在我的网站上使用插件CKEDITOR进行文字编辑.在编辑器中我有一个有两列的表.我希望在第一列中实现它,如果它将添加到(50)的用户输入数字,并且结果自动出现在第二列中.使用Jquery非常容易,但它不起作用.试用代码:

function insertIntoCkeditor(str){
  CKEDITOR.instances['editor1'].insertText(str);
}
Run Code Online (Sandbox Code Playgroud)

但此代码会自动插入编辑器的文本区域上方.

javascript jquery ckeditor ckeditor4.x

7
推荐指数
2
解决办法
1万
查看次数

如何在Laravel上创建Helper方法而不是Facade

我已经阅读了很多关于如何在Laravel 5.1上制作辅助方法的问题.但我不想在Facade中实现这一目标

HelperClass::methodName();
Run Code Online (Sandbox Code Playgroud)

我想制作一个Helper方法就像这个方法Laravel Helper方法一样:

myCustomMethod();
Run Code Online (Sandbox Code Playgroud)

我不想把它变成门面.这可能吗?怎么样?谢谢.

php helper laravel laravel-5.1

7
推荐指数
2
解决办法
2936
查看次数

Laravel如何在paginate上显示模型上的$ hidden属性

我正在使用Laravel 5.5.我读到了这个并知道这个功能,它的作用是makeVisible

$hidden = ['password', 'remember_token', 'email'];
Run Code Online (Sandbox Code Playgroud)

我可以使用显示电子邮件

$profile = auth()->user()->find($request->user()->id);
$profile->makeVisible(['email']);
Run Code Online (Sandbox Code Playgroud)

在前端电子邮件显示.但它不适用于许多结果

 // Get all users
 $users = User::with('role', 'level')->makeVisible(['email'])->paginate(10); // Doesn't work
Run Code Online (Sandbox Code Playgroud)

也尝试从Laracasts到Json这个方法它可以工作,但我不能使用paginate.你能提供其他方法或如何解决这个问题吗?我的目标是显示email隐藏的列.谢谢.

php laravel laravel-paginate laravel-5.5

7
推荐指数
3
解决办法
7651
查看次数

Bootstrap-table 重置表排序图标

我使用 bootstrap-table 从数据库中填充数据,但在如何重置表(包括“排序”功能及其图标)方面遇到了问题。我到目前为止使用过:

$('#table').bootstrapTable('resetView');
$('#table').bootstrapTable('refresh');
Run Code Online (Sandbox Code Playgroud)

http://bootstrap-table.wenzhixin.net.cn/documentation/ 上,但它们都不起作用。我有一个重置按钮,但它不起作用。

$('#resetBtn').on('click', function() {

});
Run Code Online (Sandbox Code Playgroud)

twitter-bootstrap bootstrap-table

2
推荐指数
1
解决办法
6080
查看次数