<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DB;

class SportsModel extends Model {

	//
    function selectAllSports() // display all data from database
	{
        $i = DB::table('sports')->get();
        return $i;
	}

    function insertToSports($data){
        $i = DB::table('sports')->insert($data);
        return $i;
	}

    function selectSports($q){
        $i = DB::table('sports')->where('URL', '=', $q)->get();
        return $i;
    }

    function upateSportsDetails($data, $id){
        $i = DB::table('sports')->where('Id', $id)->update($data);
        return $i;
    }

    function getSportsName() // display all data from database
    {
        $i = DB::table('sports')->select('Id', 'SportsName')->get();
        return $i;
    }
}
