当我的套接字连接打开时,我想在我的welcome.blade.php中增加一些值。
这是我的EventClass:
// app/Events/TestEvent.php
class TestEvent implements ShouldBroadcast
{
...
public function broadcastOn()
{
return new Channel('test');
}
}
这是我的路线:
// routes/web.php
Route::get('/fire', function () {
eve
请帮我解决这个奇怪的问题。我有一个页面,其中一个部分是一个HTML表单,有三个字段并提交按钮。如果我加载页面,一切都很好。如果我提交了该表格,它会给出以下错误:
ErrorException in helpers.php line 531:
htmlentities() expects parameter 1 to be string, array given (View:
C:\xampp\htdocs\beta\resources\views\admin\table\partials\form.blade.php)
(View: C:\xampp\htdocs\beta\resourc
我试图从Laravel添加Blade语法,但无法让浏览器理解Blade。当我从js文件中追加Blade语法时,它会将代码输出到页面上。
// this is my code..
$("#"+Current_box).append("@if ($errors->has('testing'))<span class='help-block'><strong>{{ $errors->first('testing') }}</strong></span>@endif
也许有人能帮我。我从我的数据库中做了一个产品清单。它显示产品的形象,标题,内容,价格,当我选择其中一个产品,它打开在新的窗口。我看不到任何产品的细节(没有图像,没有标题,没有内容),只是空洞的页面。见所有附件:我的BrackController
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\file;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Collection;
class BracControl
我正在通过JS从API中加载数据,将数据发送到并保存到数据库中。在加载完所有Ajax之后,我希望在master.blade的一个子视图/部分中显示数据--在页面完成加载之后是否可以动态地呈现一个视图--我还想更新数据库行并在视图中动态显示新的数据。
//afater Ajax loading - update / display the data in the view
public function loadcomments() {
$comments = Comment::all();
$childcomment = Childcomment::all();
ret
我在做5.5.33拉拉。我在视图文件夹中创建了几个类似index.blade.php,about.blade.php等的页面。
两个页面的路由在本地机器上都运行得很好。然后,我将项目文件夹迁移到我的共享主机。页index.blade.php的路由工作非常好,但是相同的功能不适用于任何其他文件,例如about.blade.php.。
web.php
// This function is working for index file
Route::get('/', function () {
return view('index');
});
// T
如果我想测试我的Auth页面,我会得到以下错误:
Trying to get property of non-object (View: C:\xampp\htdocs\system\app\views\home.blade.php)
这在我的home.blade.php页面上:
<?php
$username = Auth::user()->username;
$id = Auth::id();
if (Auth::check()) {
?>
Hey, if you see this, than you have been logged in
我在laravel中使用自己的用户角色和权限实现,如何在用户登录时缓存所有权限和角色,并在添加新记录时刷新缓存。我的表是users、roles、permissions、permission_role、permission_user、role_user。这是我的表结构
我已经创建了提供程序的,并将此代码添加到引导方法中
Permission::get()->map(function ($permission)
{
Gate::define($permission->name, function ($user) use ($pe