我需要在用户表中从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) 我有一个可以使用它在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) 我在我的网站上使用插件CKEDITOR进行文字编辑.在编辑器中我有一个有两列的表.我希望在第一列中实现它,如果它将添加到(50)的用户输入数字,并且结果自动出现在第二列中.使用Jquery非常容易,但它不起作用.试用代码:
function insertIntoCkeditor(str){
CKEDITOR.instances['editor1'].insertText(str);
}
Run Code Online (Sandbox Code Playgroud)
但此代码会自动插入编辑器的文本区域上方.
我已经阅读了很多关于如何在Laravel 5.1上制作辅助方法的问题.但我不想在Facade中实现这一目标
HelperClass::methodName();
Run Code Online (Sandbox Code Playgroud)
我想制作一个Helper方法就像这个方法Laravel Helper方法一样:
myCustomMethod();
Run Code Online (Sandbox Code Playgroud)
我不想把它变成门面.这可能吗?怎么样?谢谢.
我正在使用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隐藏的列.谢谢.
我使用 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) laravel ×3
php ×3
laravel-5.1 ×2
ckeditor ×1
ckeditor4.x ×1
helper ×1
javascript ×1
jquery ×1
laravel-5 ×1
laravel-5.5 ×1
migration ×1
mysql ×1
sendmail ×1
smtp ×1