first commit
This commit is contained in:
35
app/Models/SportsModel.php
Normal file
35
app/Models/SportsModel.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user