Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[myfirstcontroller]Model
<?php
namespace App\models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class mysqlModel extends Model
{
//getMariaDBUserlist
public function getUsers()
{
$data = DB::table('user')->pluck('user');
return $data->all();
}
//getMariaDBHostlist
public function getHost()
{
$data = DB::table('user')->pluck('host');
return $data->all();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment