Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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