Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hashihei/1b45c8f94d9f443a3e17fef7b51ec729 to your computer and use it in GitHub Desktop.
Save hashihei/1b45c8f94d9f443a3e17fef7b51ec729 to your computer and use it in GitHub Desktop.
[myfirstcontroller]Controller
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class myfirstController extends Controller
{
public function index()
{
//user php function
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$user_ip = $_SERVER['REMOTE_ADDR'];
//make model instance
$model_db = new mysqlModel();
$model_db_users = $model_db->getUsers();
$model_db_hosts = $model_db->getHost();
return view('ua_page',['user_agent' => $user_agent, 'ip' => $user_ip,
'modeldb_users' => $model_db_users, 'modeldb_hosts' => $model_db_hosts]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment