小编JP *_*ter的帖子

雄辩的laravel:如何从 - > get()获取行数

我在弄清楚如何使用这个集合来计算行数时遇到了很多麻烦.

$wordlist = \DB::table('wordlist')->where('id', '<=', $correctedComparisons)
                ->get();
Run Code Online (Sandbox Code Playgroud)

我尝试过adding->count()但没有奏效.我试过了count($wordlist).我不确定该做什么而不需要第二个请求作为a->count()方法.

php sql laravel eloquent

33
推荐指数
4
解决办法
9万
查看次数

CSS"margin:0 auto"不居中

好的,我知道这个主题已被涵盖.但是我已经研究过各种解决方案并且几乎没有成功.

我不知道为什么这margin: 0 auto;不起作用.我尝试补偿填充width: calc(33% - 40px);,但这不起作用.

任何帮助解决为什么会这样,解决方案将不胜感激!

.container {
  margin: 0 auto;
}

[class*='col-'] {
  float: left;
}

.col-2-3 {
  width: 66.66%;
}

.col-1-3 {
  width: 33.33%;
}

.grid:after {
  content: "";
  display: table;
  clear: both;
}

.col-word {
  width: auto;
  height: auto;
  padding: 25px;
  border: 5px #000 solid;
  border-left: 0px;
  border-right: 0px;
  background-color: #A7F4F6;
  font-size: xx-large;
  text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
<div class='container'>
  <div class="grid">
    <div class='grid'>
      <div class="col-1-3">
        <p class='col-word'>T</p>
        <p class='col-word'>V</p>
      </div>
    </div>

    <div …
Run Code Online (Sandbox Code Playgroud)

html css centering

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

laravel 5中的VARCHAR max

我已经在网上搜索了varchar max的教程.我甚至试过了

$table->string('name', "MAX");
Run Code Online (Sandbox Code Playgroud)

这给了我一个错误.

如何为laravel项目的博客文章设置varchar max.谢谢

php mysql sql laravel laravel-5

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

laravel POST输入无效

我真的不确定为什么我的控制器没有收到属性和值输入!这是我的系统.

视图

<form method="POST" action="create/attribute">
    {{ csrf_field() }}
    <div class="12u$">

      <input type="text" id="attribute" >
      <input type="text" id="value" >
    </div>

      <div class="12u$">
        <ul class="actions">
          <li><input type="submit" value="Submit" class="special" /></li>
          <li><input type="reset" value="Reset" /></li>
        </ul>
      </div>
    </form>
Run Code Online (Sandbox Code Playgroud)

调节器

public function store()
    {
        dd(request()->all());
}
Run Code Online (Sandbox Code Playgroud)

路线

Route::post('/stimulus/create/attribute', 'Attributes@store');
Run Code Online (Sandbox Code Playgroud)

当我按提交时,我收到了

    array:1 [?
  "_token" => "K4TSq9lVQq8etkH8lPDxfUJ8g9oF58wm2kJ2pwlz"
]
Run Code Online (Sandbox Code Playgroud)

但没有别的.我真的不确定我在这里缺少什么!

php laravel

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

laravel redirect-> back()没有为我提供有效的网址

所以在我的一个视图中,我生成一个redirect() - > back() - > with()命令,将用户发送回上一页.

 <a  href="{{ redirect()->back()->with('redirectRewards', true)}}"><button>Go Back</button></a>
Run Code Online (Sandbox Code Playgroud)

我遇到的问题是它没有提供我的网址.这就是我得到的.

 http://localhost:8888/pp/public/HTTP/1.0%20302%20FoundCache-Control:%20no-cacheDate:%20%20%20%20%20%20%20%20
%20%20Tue,%2024%20Nov%202015%2022:23:12%20GMTLocation:%20%20%20%20%20%20http://localhost:8888/pp/public/task/matching/response/house%3C!DOCTYPE%20html%3E%3Chtml%3E%20%20%20%20%3Chead%3E%20%20%20%20%20%20%20%20%3Cmeta%20charset=%22UTF-8%22%20/%3E%20%20%20%20%20%20%20%20%3Cmeta%20http-equiv=%22refresh%22%20content=%221;url=http://localhost:8888/pp/public/task/matching/response/house%22%20/%3
E%20%20%20%20%20%20%20%20%3Ctitle%3ERedirecting%20to%20http://localhost:8888/pp/public/task/matching/response/house%3C/title%3E%20%20%20%20%3C/head%3E%20%20%20%20%3Cbody%3E%20%20%20%20%20%20%20%20Redirecting%20to%20%3Ca%20href=%22http://localhost:8888/pp/public/task/matching/response/house%22%3Ehttp://localhost:8888/pp/public/task/matching/response/house%3C/a%3E.%20%20%20%20%3C/body%3E%3C/html%3E
Run Code Online (Sandbox Code Playgroud)

所以我在想我正在使用错误的函数但是我怎么能简单地得到一个back()url才能工作?

php laravel

0
推荐指数
1
解决办法
244
查看次数

标签 统计

laravel ×4

php ×4

sql ×2

centering ×1

css ×1

eloquent ×1

html ×1

laravel-5 ×1

mysql ×1