小编djh*_*hru的帖子

laravel 5.4 注册时将角色附加到用户

我尝试在用户注册时附加我的一个角色作为用户的默认角色,我尝试了不同的方法,例如这篇文章 https://linustechtips.com/main/topic/802733-laravel-54-attaching-role-on-registration /但没有任何效果:

我尝试附加到注册表单的作用是name => userid => 3如果您想帮助我编码

这是我的注册表:

<?php

namespace App\Http\Controllers\Auth;

use App\User;
use App\Role;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;

class RegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */

    use RegistersUsers;

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

php laravel laravel-5

0
推荐指数
1
解决办法
4720
查看次数

Laravel 5 中的定时消息

我有一个简单的想法,我只是想知道实现它的最佳方法是什么?

我想在用户登录后制作我的网站的一部分来欢迎用户,并根据时间向用户显示欢迎信息。

例如。

早上好,xxx。

下午好,xxxx。

像那样。

PS:xxxx将是用户的用户名。

知道我该怎么做吗?

php laravel

-1
推荐指数
1
解决办法
2117
查看次数

标签 统计

laravel ×2

php ×2

laravel-5 ×1