Commit cd99fa99 by Aan Choesni Herlingga

added repositories

parent f5ee17ca
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\CategoriesFile;
use App\Repositories\Repository;
use DataTables;
class CategoryFileRepository extends Repository
{
protected $model;
public function __construct(CategoriesFile $model)
{
$this->model = $model;
}
public function get($with = null, $name = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($name, function ($query) use ($name) {
return $query->where('name', 'ilike', '%' . $name . '%');
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\Categories;
use App\Repositories\Repository;
use DataTables;
class CategoryRepository extends Repository
{
protected $model;
public function __construct(Categories $model)
{
$this->model = $model;
}
public function get($with = null, $name = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($name, function ($query) use ($name) {
return $query->where('name', 'ilike', '%' . $name . '%');
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\Design;
use App\Repositories\Repository;
use DataTables;
class DesignRepository extends Repository
{
protected $model;
public function __construct(Design $model)
{
$this->model = $model;
}
public function get($with = null, $name_design = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($name_design, function ($query) use ($name_design) {
return $query->where('name_design', 'ilike', '%' . $name_design . '%');
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\File;
use App\Repositories\Repository;
use DataTables;
class FileRepository extends Repository
{
protected $model;
public function __construct(File $model)
{
$this->model = $model;
}
public function get($with = null, $title = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($title, function ($query) use ($title) {
return $query->where('title', 'ilike', '%' . $title . '%');
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\Gallery;
use App\Repositories\Repository;
use DataTables;
class GalleryRepository extends Repository
{
protected $model;
public function __construct(Gallery $model)
{
$this->model = $model;
}
public function get($with = null, $title = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($title, function ($query) use ($title) {
return $query->where('title', 'ilike', '%' . $title . '%');
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\Information;
use App\Repositories\Repository;
use DataTables;
class InformationRepository extends Repository
{
protected $model;
public function __construct(Information $model)
{
$this->model = $model;
}
public function get($with = null, $title = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($title, function ($query) use ($title) {
return $query->where('title', 'ilike', '%' . $title . '%');
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\Menu;
use App\Repositories\Repository;
use DataTables;
class MenuRepository extends Repository
{
protected $model;
public function __construct(Menu $model)
{
$this->model = $model;
}
public function get($with = null, $name = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($name, function ($query) use ($name) {
return $query->where('name', 'ilike', '%' . $name . '%');
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\Pages;
use App\Repositories\Repository;
use DataTables;
class PagesRepository extends Repository
{
protected $model;
public function __construct(Pages $model)
{
$this->model = $model;
}
public function get($with = null, $slug = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($slug, function ($query) use ($slug) {
return $query->where('slug', $slug);
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\Posts;
use App\Repositories\Repository;
use DataTables;
class PostRepository extends Repository
{
protected $model;
public function __construct(Posts $model)
{
$this->model = $model;
}
public function get($with = null, $slug = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($slug, function ($query) use ($slug) {
return $query->where('slug', $slug);
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\Setting;
use App\Repositories\Repository;
use DataTables;
class SettingRepository extends Repository
{
protected $model;
public function __construct(Setting $model)
{
$this->model = $model;
}
public function get($with = null, $name_setting = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($name_setting, function ($query) use ($name_setting) {
return $query->where('name_setting', 'ilike', '%' . $name_setting . '%');
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
<?php
namespace App\Repositories\Webprofile;
use App\Models\Webprofile\Slider;
use App\Repositories\Repository;
use DataTables;
class SliderRepository extends Repository
{
protected $model;
public function __construct(Slider $model)
{
$this->model = $model;
}
public function get($with = null, $title = null, $orderBy = null)
{
return $this->model
->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($title, function ($query) use ($title) {
return $query->where('title', 'ilike', '%' . $title . '%');
})
->when($orderBy, function ($query) use ($orderBy) {
return $query->orderBy($orderBy[0], $orderBy[1]);
})
->get();
}
public function datatable($data)
{
return DataTables::of($data)
->addIndexColumn()
->addColumn('action', function ($row) {
$btn = '<a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit</a>';
$btn = $btn . ' <a href="javascript:void(0)" data-toggle="tooltip" data-id="' . $row->id . '" data-original-title="Delete" class="btn btn-danger btn-round btn-sm delete">Delete</a>';
$btn = $btn . '<br>';
return $btn;
})
->addColumn('status', function ($row) {
if ($row->is_active == true) {
$str = '<div style="color: green;"><i class="fa fa-check"></i></div>';
} else {
$str = '<div style="color: red;"><i class="fa fa-times"></i></div>';
}
return $str;
})
->rawColumns(['action', 'status'])
->make(true);
}
}
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
"maatwebsite/excel": "^3.1", "maatwebsite/excel": "^3.1",
"milon/barcode": "^6.0", "milon/barcode": "^6.0",
"unisharp/laravel-filemanager": "~1.8", "unisharp/laravel-filemanager": "~1.8",
"uxweb/sweet-alert": "^1.4" "uxweb/sweet-alert": "^1.4",
"yajra/laravel-datatables-oracle": "~9.0"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.2", "barryvdh/laravel-debugbar": "^3.2",
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "44dcb60874d6e7ecb6c1b22aa6f059e0", "content-hash": "b61881df596933b3371ed365f3644712",
"packages": [ "packages": [
{ {
"name": "anhskohbo/no-captcha", "name": "anhskohbo/no-captcha",
...@@ -4303,6 +4303,77 @@ ...@@ -4303,6 +4303,77 @@
"environment" "environment"
], ],
"time": "2019-09-10T21:37:39+00:00" "time": "2019-09-10T21:37:39+00:00"
},
{
"name": "yajra/laravel-datatables-oracle",
"version": "v9.7.2",
"source": {
"type": "git",
"url": "https://github.com/yajra/laravel-datatables.git",
"reference": "c524b85dbc003552302c9bcfcf2da981e79f675e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/c524b85dbc003552302c9bcfcf2da981e79f675e",
"reference": "c524b85dbc003552302c9bcfcf2da981e79f675e",
"shasum": ""
},
"require": {
"illuminate/database": "5.8.*|^6.0",
"illuminate/filesystem": "5.8.*|^6.0",
"illuminate/http": "5.8.*|^6.0",
"illuminate/support": "5.8.*|^6.0",
"illuminate/view": "5.8.*|^6.0",
"php": "^7.1.3"
},
"require-dev": {
"orchestra/testbench": "^3.8"
},
"suggest": {
"yajra/laravel-datatables-buttons": "Plugin for server-side exporting of dataTables.",
"yajra/laravel-datatables-editor": "Plugin to use DataTables Editor (requires a license).",
"yajra/laravel-datatables-fractal": "Plugin for server-side response using Fractal.",
"yajra/laravel-datatables-html": "Plugin for server-side HTML builder of dataTables."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "9.0-dev"
},
"laravel": {
"providers": [
"Yajra\\DataTables\\DataTablesServiceProvider"
],
"aliases": {
"DataTables": "Yajra\\DataTables\\Facades\\DataTables"
}
}
},
"autoload": {
"psr-4": {
"Yajra\\DataTables\\": "src/"
},
"files": [
"src/helper.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Arjay Angeles",
"email": "aqangeles@gmail.com"
}
],
"description": "jQuery DataTables API for Laravel 4|5",
"keywords": [
"datatables",
"jquery",
"laravel"
],
"time": "2019-11-11T15:07:50+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment