我有一个杂乱的数据库表,每次用户访问另一个用户的配置文件时都会更新。不过,我在创建手动时间戳列时遇到了问题。因为我没有为此创建模型,所以我手动创建,这应该不是问题,因为这个数据库不接受任何用户生成的输入。
迁移:
public function up()
{
Schema::create('recently_visited', function (Blueprint $table) {
$table->increments('id');
$table->integer('visitor_id')
我正在实施拉拉通知。通知存储在通知表中。我试图获取数据列中的数据并在刀片中显示,但失败了。
这是我的控制器
public function notification_list(){
$notifications = auth()->user()->notifications()->orderBy('created_at','desc')->get();
return view('users.notification.index')->with('notifications',$not
我希望将多个列值插入到一个表“答案”中。我正在从问题表中插入一个question_id,该表正在成功插入。
但是它现在并没有插入auth:user() id,而是在表中返回'0‘
应答控制器代码:
<?php
namespace App\Http\Controllers;
use App\questions;
use Illuminate\Http\Request;
use Auth;
use App\Http\Requests;
class answerController extends Controller
{
public function store($q
我用拉拉8:
public function up()
{
Schema::create('user', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->integer('created_by')->nullable();
$table->string
我正在导入的文件有数以千计的记录,这导致我的网络变得缓慢。在将这些列插入数据库之前,我只想读取所需的列。当文件被处理时,它应该首先搜索那些列而不是整个文件,并获取这些列的行。
Excel::load($path, function($reader) {
//Getting headers using this
$headers = $reader->first()->keys()->toArray();
//This is the array of required columns
$headings = array('regis