Skip to content

Instantly share code, notes, and snippets.

View brandonsueur's full-sized avatar

brandonsueur

View GitHub Profile
<?php
protected function create(array $data)
{
$user = User::create([
'first_name' => $data['first_name'],
'last_name' => $data['last_name'],
'username' => strtolower($data['first_name'] . $data['last_name']),
'phone' => $data['phone'],
'email' => $data['email'],
'verified' => false,
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Support\Facades\Auth;
use App\Http\Requests\UserAddRequest;
use App\LogActivity;
use Illuminate\Support\Facades\Hash;
@brandonsueur
brandonsueur / auth.js
Created September 5, 2019 11:17
auth react
import decode from 'jwt-decode';
export default class AuthService {
constructor(domain) {
this.domain = domain || 'http://localhost:8080'
this.fetch = this.fetch.bind(this)
this.login = this.login.bind(this)
this.getProfile = this.getProfile.bind(this)
}
@brandonsueur
brandonsueur / auth.js
Created September 5, 2019 11:17
auth react
import decode from 'jwt-decode';
export default class AuthService {
constructor(domain) {
this.domain = domain || 'http://localhost:8080'
this.fetch = this.fetch.bind(this)
this.login = this.login.bind(this)
this.getProfile = this.getProfile.bind(this)
}
<?php
namespace App\Http\Controllers\Auth;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Auth\Events\Registered;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
<?php
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
class UsersController extends Controller
{
/**
{
"animation_enabled": false,
"block_caret": true,
"color_scheme": "Packages/Theme - One Dark/Widget - One Dark.tmTheme",
"detect_indentation": true,
"draw_white_space": "selection",
"enable_tab_scrolling": false,
"fold_buttons": false,
"folder_exclude_patterns":
[
@brandonsueur
brandonsueur / background.css
Created March 16, 2019 20:53
dots background css
body {
font-family: Avenir, Futura, 'Open Sans', 'Gill Sans', 'Helvetica Neue', Ariel, sans-serif;
font-weight: bold;
font-size: 6vw;
margin: 0 1em;
background: radial-gradient(#c2c2c2 8%, transparent 8%), white;
background-position: 0 0, 25px 25px;
background-size: 25px 25px;
min-height: 100vh;
display: flex;
@brandonsueur
brandonsueur / isOnline.js
Created March 16, 2019 13:10
Component React for check is online
import { Component } from 'react';
import PropTypes from 'prop-types';
const isNavigatorOnline = () => navigator.onLine || false;
export default class IsOnline extends Component {
static propTypes = {
OnlineComponent: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
OfflineComponent: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
onChange: PropTypes.func,