首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >路由[categories.update1]未定义。(浏览: C:\xampp\htdocs\cms\resources\views\categories\create.blade.php)

路由[categories.update1]未定义。(浏览: C:\xampp\htdocs\cms\resources\views\categories\create.blade.php)
EN

Stack Overflow用户
提问于 2021-04-16 06:56:06
回答 2查看 409关注 0票数 0

我试图提高我的编辑值,但当我点击编辑按钮,然后显示这个错误。

这里是我的代码:

代码语言:javascript
复制
<form action="{{ isset($category) ? route('categories.update'. 
$category->id):route('categories.store')}}" method="POST">
@csrf
    <div class="form-group mx-3">
        <label for="name" >Name</label>
        <input type="text" id="name" class="form-control" name="name" value=" {{isset($category)? 
         $category->name:''}} ">
    
    </div>
    <div class="form-group mx-3">
        <button class="btn btn-success">Add category</button>
    </div>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-04-16 07:25:06

您有语法错误

route('categories.update'. $category->id)

route('categories.update',$category->id)

删除.并使用,

放置.,这意味着并发,这就是为什么您获得categories.update1] not defined.这个错误,您可以使用1 id与categories.update连接

票数 0
EN

Stack Overflow用户

发布于 2021-04-16 06:58:54

修复您的路由名称,不要连接它,而是将它包装成数组。

代码语言:javascript
复制
route('categories.update', ['category' => $category->id]) : route('categories.store')
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67120461

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档