Outils pour utilisateurs

Outils du site


coach_energie:user.php
<?php
 
namespace App\Models ;
 
use Illuminate\Database\Eloquent\Model;
 
class User extends Model
{
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['email', 'lastname', 'firstname', 'password'];
 
    public static function inscription ($email, $lastname, $firstname, $password)
	{
		$usersok = User::where('email', $email)->count();
		if ($usersok == 0)
		{
			echo "test usersok ".$usersok."\n";
			$users = User::create(
			[
				'email' => $email,
				'lastname' => $lastname,
				'firstname' => $firstname,
				'password' => $password
			]);
			return true;
		}
		else
			return false;
	}
}
coach_energie/user.php.txt · Dernière modification : 21/08/2020 13:26 de 127.0.0.1