小编sho*_*cus的帖子

调用未定义的方法Illuminate\Routing\Route :: get()

我刚刚安装了Laravel 5.1,访问了我的应用程序的主页,我收到以下错误:

哎呀,看起来像出事了.

1/1

routes.php第16行中的FatalErrorException:

调用未定义的方法Illuminate\Routing\Route :: get()

在routes.php第16行

这是我的routes.php文件:

<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/



Route::get('/', function () {
    return view('welcome');
});
Run Code Online (Sandbox Code Playgroud)

php phpstorm laravel laravel-routing laravel-5

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

数据库规范化

我是数据库设计的新手,我已经阅读了很多关于规范化的内容.如果我有三张桌子:住宿,火车站和机场.我是否在每个表中都有地址列或其他表引用的地址表?是否存在过度规范化的问题?

谢谢

database database-design normalization database-normalization

9
推荐指数
2
解决办法
4758
查看次数

在表单提交时从URL中剥离锚标记

自由格式版本:4.07 ExpressionEngine v2.5.3 - 构建日期:20120911

我在jQuery选项卡中有一个自由格式表单.当表单与erros一起提交时,该标签的锚点将从URL中删除.这会将我带回第一个选项卡,而不是带有表单的选项卡.有没有办法将用户重定向回表单选项卡?

谢谢

<li id="qaTab">
  {exp:freeform:form
  form_id="2"
  required="name|email|user_message"
  return="contact_us/thank_you"
  recipients="yes"
  recipient1="Happy Harry|h_harry@somemail.com"
  recipient2="Lazy Larry|lazyl63@somemail.com"
  recipient_template="contact_form"
  notify_user="yes"
  user_email_field="user_email"
  inline_errors="yes"
  }
   {if freeform:general_errors}
    <h2>There were some error(s) with your submission:</h2>
   <ul>
   {freeform:general_errors}
    <li>{freeform:error_message}</li>
   {/freeform:general_errors}
   </ul>
   {/if}
   <div class="row">
    <div class="six columns">
     <label>{freeform:label:name}</label>
     {freeform:field:name}
     {if freeform:error:name}<small class="error">{freeform:error:name}</small>{/if}
    </div>
    <div class="six columns">
     <label>{freeform:label:email}</label>
     {freeform:field:email}
     {if freeform:error:email}<small class="error">{freeform:error:email}</small>{/if}
    </div>
   </div>
   {freeform:label:user_message}
   {freeform:field:user_message}
   {if freeform:error:user_message}
   <small class="error">{freeform:error:user_message}</small>{/if}
   <input type="hidden" name="subject" value="{title}" id="subject">
   <input type="submit" name="submit" value="Submit" id="submit" class="button">
  {/exp:freeform:form}
 </li> 
Run Code Online (Sandbox Code Playgroud)

jquery expressionengine zurb-foundation

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

使用唯一字段更新 Laravel 模型

如果模型具有唯一字段,我将无法更新模型。我收到消息“名称已被占用”。

我的控制器:

/**
 * Update the specified Category in storage.
 *
 * @param  int              $id
 * @param UpdateCategoryRequest $request
 *
 * @return Response
 */
public function update($id, UpdateCategoryRequest $request)
{
    $category = $this->categoryRepository->findWithoutFail($id);

    if (empty($category)) {
        Flash::error('Category not found');

        return redirect(route('categories.index'));
    }

    $category = $this->categoryRepository->update($request->all(), $id);

    Flash::success('Category updated successfully.');

    return redirect(route('categories.index'));
}
Run Code Online (Sandbox Code Playgroud)

更新类别请求

 /**
 * Get the validation rules that apply to the request.
 *
 * @return array
 */
public function rules()
{
    return Category::$rules;
}
Run Code Online (Sandbox Code Playgroud)

类别模型

    /**
 * Validation …
Run Code Online (Sandbox Code Playgroud)

php validation laravel laravel-5 laravel-5.2

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

使用Git管理Yii应用程序

如果我的Yii应用程序有一个公共Git存储库.我想知道如何将DB配置设置保密?我不能忽略整个文件.

git github yii

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