laravel-8 相关问题


未定义的变量:Laravel 8 上的 __env

这是我的代码: @foreach($comments->where("id_answered_comment", null) as $comment) @php


Laravel 8 项目中的角色关联问题

我在 Laravel 8 上遇到语法问题。 在以前的版本中,我能够在路线上关联一组角色来定义用户是否有权访问特定路线。基本上...


Inertia.js 和 Laravel - 视图如何自动接收 auth::user() 对象?

我目前正在开发 Laravel 8 项目,第一次尝试将提供的 Laravel Breeze 脚手架与 Inertia.js 和 Vue 一起使用。在最初的仪表板脚手架中,仪表板...


如何从mysql程序获取laravel端的数据?

在使用 mysql 8 的 laravel 8 站点上,我创建了一个带有 1 个输入和 2 个输出参数的过程: 分隔符 $$ 如果存在则删除过程 getObjectsCount $$ 创建定义器=`lardev`@`localhost`过程`


Laravel 8 中的非法运算符和值组合

为什么做超过7天总是出错? 公共函数分页(请求$请求) { $fromDate = $request->fromDate ? Carbon::parse($request->fromDate) : Carbon::now();...


如何清除 Laravel 8 中数据库设置的缓存?

我已在我的网络服务器上部署了我的项目。 .env 包含 Web 数据库的正确设置,但由于某种原因 Laravel 仍然尝试连接到本地主机。 问题是,如果我使用...


Laravel 8 验证数组

我有一个 Laravel 8 表单,其中包含一系列用户联系方式。 我有一个 Laravel 8 表单,其中包含一系列用户联系方式。 <div> <input name="contactdetails[{{ $key }}][email]" type="text"> <input name=" contactdetails [{{ $key }}][mobile]" type="text"> </div <div> <input name=" contactdetails [{{ $key }}][email]" type="text"> <input name=" contactdetails [{{ $key }}][mobile]" type="text"> </div <div> <input name=" contactdetails [{{ $key }}][email]" type="text"> <input name=" contactdetails [{{ $key }}][mobile]" type="text"> </div 我的验证规则如下所示: contactdetails.*.email=> ‘email:rfc,dns’, contactdetails.*. mobile => required_with:email|numeric', 我需要验证是否至少输入了一封电子邮件(但不是全部)以及相应的手机。 你必须这样做: 'contactdetails' => 'array|min:1', 'contactdetails.*.email' => 'email:rfc,dns', 'contactdetails.*.mobile' => 'required_with:contactdetails.*.email|numeric|nullable', 这意味着 contactdetails 必须是数组并且至少有一个成员 并更好地添加正则表达式移动角色来验证正确的手机号码


如何在 laravel 10 中使用 Laravel-mix

似乎无法配置 laravel-mix 包。 嘿,我想在 laravel 10 中使用 laravel-mix 包,但我似乎无法正确配置它,因为当我运行 npx mix 时,我不断收到错误...


如何在 ggplot2 图表中的处理之间放置空格

我刚刚做了这个图表 使用这组数据 G 时间 1 7 1 9 1 8 1 7 1 6 1 8 1 7 1 8 1 7 1 7 1 6 1 7 1 7 1 9 1 9 2 9 2 7 2 8 2 8 2 9 2 8 2 9 2 7 2 10 2 9 2 7 2 8 2 8 2 7...


Laravel Inertia VueJs 的本地化

我正在尝试在 Laravel Inerita (Vue.js) 上设置本地化。我知道 https://github.com/mcamara/laravel-localization,但这不支持 Inertia(至少我没有成功


如何在 ggplot2 图表中的某些组之间插入空格

我刚刚做了这个图表 使用这组数据 G 时间 1 7 1 9 1 8 1 7 1 6 1 8 1 7 1 8 1 7 1 7 1 6 1 7 1 7 1 9 1 9 2 9 2 7 2 8 2 8 2 9 2 8 2 9 2 7 2 10 2 9 2 7 2 8 2 8 2 7...


Composer 版本匹配错误 laravel + spatie medialibrary

我尝试通过 laravel 安装程序使用 laravel new 创建一个新的 laravel 应用程序。 这工作没有问题。当我尝试安装 spatie/medialibrary 时,我收到以下错误...


我如何根据状态更改按钮颜色(绿色表示“接受”,红色表示“删除”)

如何根据状态更改按钮颜色(绿色表示“接受”,红色表示“删除”) 我是新人,为此使用 Laravel 框架。 这是我的观点 如何根据状态更改按钮颜色(绿色表示“接受”,红色表示“删除”) 我是新人,为此使用 Laravel 框架。 这是我的看法 <table class="table table-striped" id="example"> <thead> <tr> <th>ID no</th> <th>Form Name</th> <th style="text-align: center">Update</th> <th>Delete</th> <th>Status</th> </tr> </thead> @foreach($form as $show) {{--modal--}} <div class="modal fade mj_popupdesign mj_checkoutpopup" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-body"> <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12 col-lg-offset-2 col-md-offset-2"> <div class="row"> <div class="mj_pricingtable mj_greentable mj_login_form_wrapper"> <form> <div class="mj_login_form"> <p>Are you sure you want to delete this post?</p> <br> <a href="" class="mj_btn btn btn-default pull-right glyphicon glyphicon-remove "> No</a> <a href="{{url('deleteForm',$show->id)}}" class=" pull-right mj_btn btn btn-danger glyphicon glyphicon-ok"> Yes</a> </div> </form> </div> </div> </div> </div> </div> </div> </div> {{--end modal--}} <tbody> <tr> <td> <p> {{$show->id}}</p> </td> <td> <h6><a href="{{url('JobDetails',$show->id)}}"style="color: rgb(0, 191, 243);font-size:18px;float: left;margin: 0;text-align: left">{{$show->jobTitle}}</a> </h6> <p> {{$show->created_at}} </p> </td> <td> <a href="{{url('UpdateFormView',$show->id)}}"> <span class="mj_btn btn btn-success">Update</span> </a> </td> <td> <span class="mj_btn btn btn-danger" data-toggle="modal" data-target="#myModal2">Delete</span> </td> <td><span class="mj_btn btn btn-warning">pending</span> </td> </tr> </tbody> @endforeach </table> </div> </div> </div> </div> 在我的控制器中public function AcquiredForm() { $acquired="Requirement Form"; $acquireForm=Job::where('jobType','LIKE','%'.$acquired.'%'); $form = $acquireForm->get(); return view('private-pages.company.aquire-form',compact('form')); } 数据库状态默认为待处理 数据库状态默认为pending 我在代码中没有看到 status 属性,但显示状态为待处理的纯字符串 <span class="mj_btn btn btn-warning">pending</span> <!-- while it suppose to be --> <span class="mj_btn btn btn-warning">{{ $show->status }}</span> 假设它确实存在,你可以做 <td> @if ($show->status === 'Accept') <span class="mj_btn btn btn-green">Accepted</span> @elseif ($show->status === 'Delete') <span class="mj_btn btn btn-danger">Deleted</span> @else <span class="mj_btn btn btn-warning">Pending</span> @endif </td> 参见:https://laravel.com/docs/5.1/blade#displaying-data <td> @if ($show->jobstatus === "Accepted") <span class="mj_btn btn btn-success">Accepted</span> @elseif ($show->jobstatus === "Rejected") <span class="mj_btn btn btn-danger">Rejected</span> @else <span class="mj_btn btn btn-warning">Pending</span> @endif </td> 或者当你使用 1. laravel esialy customaize this code nad add automatic refresh in the page to more interactive @php if($da->status == "requested") { echo "<td><button class='btn btn-primary'>Requested</button></td>"; } else { echo "<td><button class='btn btn-success'>Ordered</button></td>"; } @endphp


将文件从 drupal 7 迁移到 drupal 8

我有 Drupal 7 网站,我需要将其升级到 Drupal 8 我已按照 drupal 网站文档使用网络浏览器升级到 drupal 8 https://www.drupal.org/docs/8/upgrade/upgrade-乌西...


Laravel 10 Vite“npm run build”创建空文件

由于某种原因,运行该命令时,某些脚本会编译,而某些脚本的内容会被“删除”。这是我的 vite.config.js 文件: 从“laravel-vite-plugin”导入 laravel; 导入vu...


Cloudfoundry Laravel“无法打开输入文件:artisan”

我正在尝试使用 CF CLI 推送 Laravel 应用程序。 我创建了一个新的 Laravel 应用程序(manifest.yml)并尝试部署它,但收到错误“无法打开输入文件:artisan”...


如何在 Laravel 项目中使用 DD() 方法?

我需要知道如何在 Laravel 项目中正确使用 dd() 函数。 例如 - 我有任务来调试我的项目(PHP /Laravel)中的一些代码和功能,这总是需要我


禁用 Laravel 调试器

我有一个不是我开发的 Laravel 应用程序。每个页面的底部都有一些奇怪的栏,它是某种类型的 Laravel 调试器工具。 我相信它存储在存储/调试器中。是


Laravel webhook 客户端在 Whatsapp Webhook url 上出现错误 405

我尝试在whatsapp云中使用laravel进行webhook,但它显示此错误 脸书错误 并在 ngrok 中显示此错误 恩格罗克错误 我使用 https://github.com/spatie/laravel-webhook-client


Laravel 9 突变冒号

在 Laravel 9 中,变异器有不同的实现。以下示例来自官方文档。 受保护函数firstName():属性 { 返回属性::make( ...


将 Laravel 的 .env 文件复制到 Docker 容器中

设置 我正在 Ubuntu 服务器上运行 Docker,并尝试创建一个 Laravel 容器来使用 artisan 运行我的网站。 Laravel 项目位于 GitHub 存储库内,我将该项目克隆到...


Laravel Passport 登录无法使用 Jetstream Inertia 正确重定向

我已经用 Laravel Passport 实现了一个 OAuth 系统,但是该系统的登录和所有身份验证都是由 Laravel Jetstream 和 Inertia 处理的。 当我想请求代码时(使用


在哪里使用 dd() 函数来调试 Laravel 应用程序?

我需要知道如何在 Laravel 项目中正确使用 dd() 函数。 例如 - 我有任务来调试我的项目(PHP /Laravel)中的一些代码和功能,这总是需要我


Laravel 测试assertSessionDoesntHaveErrors() 没有发现错误?

我想在 Laravel 测试中断言两件事: 对象已成功更改(例如,assertSee('New value')) 会话中没有错误(例如,assertSessionDoesntHaveErrors())


部署后的 Laravel 护照

我在 aws ec2 实例上运行 laravel 应用程序,并使用 laravel 护照通过不记名令牌来保护我的 api。 每次部署后,护照密钥都消失了,所以我在...之后添加了护照:安装命令


如何在 vitest 中测试 laravel sainttum 路线

我有一个应用程序,使用 Vue 框架作为客户端,使用 laravel 框架作为服务器。 我的身份验证是通过 laravel sainttum 完成的,这是一个基于 cookie 的身份验证系统。 我当前的设置...


设置中间件以接受字符串或 null

我正在尝试在 Laravel Inerita (Vue.js) 上设置本地化。我知道 https://github.com/mcamara/laravel-localization,但这不支持 Inertia(至少我没有成功


Httpie 命令提示在 Laravel 中无法正常工作

在 Laravel 10 项目中工作,我将使用以下 LoginController 将电话号码插入表中 公共函数提交(请求$请求) { $请求->验证([ ...


为什么 Laravel 执行最后一条匹配的路由?

我刚刚在 Laravel 中开始了一个新项目。我读到 Laravel 应该转到第一个匹配的路线,但在这里它会转到最后一个匹配的路线。如果我删除第三条路线,它会转到第二条...


Laravel 7 Sanctum 注销

我正在为我的应用程序使用 Laravel 7 和 Sanctum 身份验证。 如何执行注销程序? 我用: Auth::user()->tokens()->delete(); 它有效,但它删除了这个的所有标记......


OrderBy Laravel 雄辩关系

我想根据listing_packages.order订购listing_data。这是查询 ListingData::with(['listing_package'])->orderBy('listing_package.order','desc')->paginate(24); 我会...


在 Python 中合并 DataFrame 列

我有一个特殊的数据框,称为 df 这是它的样子 RepID +Col01 +Col02 +Col03 -Col01 +Col04 +Col05 -Col03 -Col04 +Col06 -Col07 1 5 7 9 8 3 8...


Laravel 计划 - Azure 门户中的 AppSettings

我正在 Azure 上运行 Laravel 应用程序(Linux 上的应用程序服务),并且我在门户本身中设置了一些设置,例如: DB_DATABASE=mydbname DB_USERNAME=mydbuser DB_PASSWORD=mydbuserpwd 这些值...


Laravel:如何检查数据库中的模型字段是否可为空

保存时我将所有空字段设置为空 使用OctoberCMS模型事件beforeSave(相当于Laravel模型保存) 公共函数 beforeSave() { // $this => 模型 foreach ( $


如何在 Laravel 中添加外部 scss 文件?

我从Colorlib购买了一个主题,Bootstrap Sidebar V02,包含SCSS文件。将这个外部 SCSS 文件添加到 Laravel 项目的相关方法是什么? mix.sass('资源/sass/样式。


如何在会话 Laravel 中存储输入

我是 Laravel 的新手,我尝试将我的输入表单发布到会话中,但它不起作用,我收到此错误,但没有任何消息: Symfony \ 组件 \ HttpKernel \ 异常 \


Laravel 找不到驱动程序 Cpanel

我在 Cpanel 上部署了 Laravel 项目,但出现错误“无法找到驱动程序(SQL)” 我在Cpanel中使用Mysql数据库,并且我在PHP扩展中检查了pdo_mysql。 但当我看...


警告:[选项]源值 8 已过时,将在未来版本中删除

当我运行我的 flutter 应用程序时遇到此错误。 3 条警告 警告:[选项] 源值 8 已过时,将在未来版本中删除 警告:[选项] 目标值 8 已过时并且...


Laravel - 如何将参数传递给路由控制器中的函数?

我正在使用 Laravel Fortify 来注册我的用户。 我有多种用户。 以下是访问注册控制器的代码: 路线::发布( RoutePath::for('注册', '/注册'...


Laravel 5.3,empty() 在查询中将零值视为空

在我的 laravel 项目(版本 5.3)中,我在 URL 中发送一个参数: 容器=0 但当它进入创建 SQL 查询的 PHP 函数时,它会将零视为空并满足...


如何在laravel中通过用户名查找用户?

我在构建 Laravel API 时尝试通过用户名查找用户。这就是我正在尝试的 api.php 路线::get('用户配置文件/用户/{用户}', 'UserProfileController@getUserProfile'); 控制器 公开


Laravel 类“数据表”未找到错误?

我正在开发一个应用程序,从 Mysql 数据库检索数据并使用 Laravel 和 Datatable 显示它,我不断收到此错误: “未找到‘数据表’类” 我尝试了不同的版本...


更新到.net 8 会破坏 Bearer Token 授权

我的实现工作正常,直到更新到 .net 8。 现在我只收到 401。 已尝试所有相关SO问题的答案,但无济于事


Laravel 验证不允许全部为 false

我是Laravel框架的初学者。 我正在努力声明请求数据的验证。 我的表单中有一些复选框,并且必须至少选中其中一个复选框才能提交数据...


根据时分列创建年月日序列

我有以下数据集: 结构(列表(Zeit = c("8:30:00 PM", "8:45:00 PM", "9:00:00 PM", “晚上 9:15:00”、“晚上 9:30:00”、“晚上 9:45:00”、&


如何在共享主机上部署 laravel websockets?

我已经在本地主机上设置了我的 laravel websockets,它在本地主机上运行良好,但是当我将其上传到生产服务器时,出现以下错误。 WebSocket 连接到 'ws:/app/so...


修改现有的.htaccess,使其忽略子域

我有以下 .htaccess 文件,虽然我知道它远非最佳(并且可能有点令人畏惧) - 它只是有效。 # 防止公众查看 .htaccess 文件 我有以下 .htaccess 文件,虽然我知道它远非最佳(而且可能有点令人难受) - 它只是有效。 # Prevents public viewing of .htaccess file <Files .htaccess> order allow,deny deny from all </Files> # Custom 404 page ErrorDocument 404 https://www.domain.com/404/ # Turn on rewriting and set rewriting base RewriteEngine On RewriteBase / # Force WWW RewriteCond %{HTTP_HOST} !^$ RewriteCond %{HTTP_HOST} ^([^.]+)\.([a-z]{2,4})$ [NC] RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=302,L] # Force WWW and HTTPS RewriteCond %{HTTP_HOST} !^www\. [NC,OR] RewriteCond %{HTTPS} off RewriteRule ^ https://www.domain.com%{REQUEST_URI} [R=301,L] # Remove .php extension RewriteRule ^(properties)/(all|location1|location2|location3)/(all|1|2|3|4|5|6|7|8|9)/(asc|desc) $1.php?location=$2&bedrooms=$3&sort-by=$4 RewriteRule ^(properties)/(all|location1|location2|location3)/(all|1|2|3|4|5|6|7|8|9) $1.php?location=$2&bedrooms=$3 RewriteRule ^(properties)/(all|location1|location2|location3) $1.php?location=$2 RewriteRule ^(view-property)/(.*)/(print-view) $1.php?id=$2&print=true RewriteRule ^(view-property)/(.*)/ $1.php?id=$2 RewriteRule ^(.*)/$ $1.php 我们的新网站现已准备好推送到我们新创建的临时环境中进行测试。在本例中,它会是 staging.domain.com,但我们在实际访问此暂存 URL 时遇到问题。 编辑 - 只是为了澄清,问题是访问 staging.domain.com 重定向到 https://www.domain.com。 我们认为问题是由我们上面的重写规则引起的。我研究了一些可能的解决方案,包括向现有重写规则添加附加条件,例如: RewriteCond %{HTTP_HOST} !^staging\.domain\.com 或添加新的条件/规则,例如: RewriteCond %{HTTP_HOST} ^staging\.domain\.com [NC] RewriteRule ^(.*) - [L] 但不幸的是这些都不起作用。使用 .htaccess 文件确实不是我的强项,所以如果有人可以提供任何帮助,那就太好了。 附注新网站由 Laravel 5.3 提供支持,因此当我们上线时,我将摆脱重写规则(位于底部的规则)的可怕尝试! 您的顶级规则必须更改为此以删除目标 URL 中的硬编码域名: # Turn on rewriting and set rewriting base RewriteEngine On RewriteBase / # Force WWW and HTTPS RewriteCond %{HTTP_HOST} !^www\. [NC,OR] RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L,NE] # Remove .php extension and rest of the rewrite rules Crypto.com 登录问题 已经是 crypto.com 登录用户?继续作为 crypto.com 登录问题用户。或者。电子邮件。密码。登录 忘记密码?没有帐户?立即注册。注册 Crypto.com NFT 帐户 · 连接您经过验证的 crypto.com 登录问题 · 提交申请成为创建者 Trezor suite 应用程序 移动版 Trezor Suite Lite 是一款免费应用程序,可让您同步和跟踪所有比特币和加密货币您手机上的帐户。适用于 Trezor 硬件钱包的新桌面和浏览器应用程序。 Trezor Suite 在可用性、安全性和隐私这三个关键支柱上带来了重大改进。


显示截断文本的阅读更多链接

我有8个属于bios_ellipsis类的div,有8个属于read_more类的链接。当浏览器变小时,clientWidth也会变小,我在or中使用以下css...


SSL 证书问题:无法在 Laravel 中使用 Twilio 获取本地颁发者证书

将 Laravel 应用程序与短信发送器 Twilio 结合使用。我将使用以下 LoginController 将电话号码插入表中 公共函数提交(请求$请求) { $请求->


如何从用户界面CRM创建备份?

我正在尝试为我的 CRM 创建备份选项。我已经安装了这个包 https://spatie.be/docs/laravel-backup/v5/take-backups/overview 并且我正在使用 laravel 6^。我可以备份我的数据库和所有系统...


© www.soinside.com 2019 - 2024. All rights reserved.