小编ka *_*ern的帖子

Laravel Blade中的动态行数

我希望像这样的表中的动态行数.

number   name
1        Devy
Run Code Online (Sandbox Code Playgroud)

这是我的Blade模板.

<thead>
        <th>number</th>
        <th>name</th>
</thead>
<tbody>
    @foreach ($aaa as $value)
        <tr>
            <td></td>
            <td>{{$value->name}}</td>
        </tr>
    @endforeach
</tbody>
Run Code Online (Sandbox Code Playgroud)

我怎么做?

php laravel blade

6
推荐指数
4
解决办法
8403
查看次数

基本 Laravel 身份验证无法登录

我有 ID 和密码,在表帐户中。我将使用 ID 和密码登录。而且结果很糟糕

验证文件

'driver' => 'database',
'model' => 'Pass',
'table' => 'account',
Run Code Online (Sandbox Code Playgroud)

模型/Pass.php

use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;

class Pass extends \Eloquent implements UserInterface, RemindableInterface 
{
    use UserTrait, RemindableTrait;

protected $table = 'account';
Run Code Online (Sandbox Code Playgroud)

PassController.php

public function authenticate()
{
$userdata = array( 'id' => Input::get('id'), 'password' => Input::get('password'));
    if(Auth::attempt($userdata)) 
    {
        echo 'oke';
    } 
    else 
    {
        echo 'bad';
    }
}
Run Code Online (Sandbox Code Playgroud)

在视图中

{{Form::open(array('action' => 'PassController@authenticate')) }}
...
Run Code Online (Sandbox Code Playgroud)

路线.php

Route::post('book/auth', 'PassController@authenticate');
Run Code Online (Sandbox Code Playgroud)

如何解决这个问题?我用的是 Laravel 4.2

php authentication laravel

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

标签 统计

laravel ×2

php ×2

authentication ×1

blade ×1