public function run() { $faker = Faker\Factory::create(); $users = User::all(); foreach ($users as $user) { UserToken::create(['user_id' => $user->id, 'user_ip' => $faker->ipv4, 'device_token' => $faker->password, 'device_name' => $faker->colorName, 'token' => str_repeat($user->id, 6), 'last_usage' => \Carbon\Carbon::now()]); } }
public function index() { // if (!Entrust::can('user-read')) { return redirect(''); } $this->data['sub_title'] = 'List User'; $this->data['users'] = User::all(); return view('backend.user.index', $this->data); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { return view('admin.index.user', ["users" => User::all(), "roles" => Role::all()]); }