Skip to content

Commit

Permalink
updated blade and scss
Browse files Browse the repository at this point in the history
  • Loading branch information
chiragmistry007 committed Feb 7, 2022
1 parent 9cbeda6 commit 2cbba5b
Show file tree
Hide file tree
Showing 237 changed files with 14,012 additions and 6,693 deletions.
47 changes: 35 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
</a>
</p>
<p align="center">
<a href="https://github.com/iqonicdesignofficial/hope-ui-laravel-dashboard/" target="__blank"><img src="https://img.shields.io/github/stars/iqonicdesignofficial/hope-ui-laravel-dashboard" /> </a>
<a href="https://github.com/iqonicdesignofficial/hope-ui-laravel-dashboard/network" target="__blank"><img src="https://img.shields.io/github/forks/iqonicdesignofficial/hope-ui-laravel-dashboard" /> </a>
<a href="https://github.com/iqonicdesignofficial/hope-ui-laravel-dashboard/issues" target="__blank"><img src="https://img.shields.io/github/issues/iqonicdesignofficial/hope-ui-laravel-dashboard" /> </a>
<a href="https://github.com/iqonicdesignofficial/hope-ui-design-system/" target="__blank"><img src="https://img.shields.io/github/stars/iqonicdesignofficial/hope-ui-design-system" /> </a>
<a href="https://github.com/iqonicdesignofficial/hope-ui-design-system/network" target="__blank"><img src="https://img.shields.io/github/forks/iqonicdesignofficial/hope-ui-design-system" /> </a>
<a href="https://github.com/iqonicdesignofficial/hope-ui-design-system/issues" target="__blank"><img src="https://img.shields.io/github/issues/iqonicdesignofficial/hope-ui-design-system" /> </a>
<a href="#" target="__blank"><img src="https://img.shields.io/bower/v/editor.md.svg" /> </a>
<a href="https://github.com/iqonicdesignofficial/hope-ui-laravel-dashboard/blob/main/LICENSE" target="__blank"><img src="https://img.shields.io/github/license/iqonicdesignofficial/hope-ui-laravel-dashboard" /> </a>
<a href="https://github.com/iqonicdesignofficial/hope-ui-design-system/blob/main/LICENSE" target="__blank"><img src="https://img.shields.io/github/license/iqonicdesignofficial/hope-ui-design-system" /> </a>
<a href="https://twitter.com/iqonicdesign" target="__blank"><img src="https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Fiqonicdesign" /></a>
</p>
<h3 align="center">Free Open Source Bootstrap 5 Design System.</h3>
Expand Down Expand Up @@ -72,7 +72,8 @@ Built ideally for developers, designers, and startups, or Creators, Hope UI brin

- [Quick Start](#quick-start)
- [Method 1: Direct Download](#method-1-direct-download)
- [Method 2: Using NPM](#method-2-using-npm)
- [Method 2: Using CDN](#method-2-using-cdn)
- [Method 3: Using NPM](#method-3-using-npm)
- [Documentation](#documentation)
- [Version](#version)
- [Public RoadMap](#public-roadmap)
Expand All @@ -91,11 +92,18 @@ Built ideally for developers, designers, and startups, or Creators, Hope UI brin
You can use following method to get started with CSS and JS files of the design system.

### Method 1: Direct Download
[Dowload from Github](https://github.com/iqonicdesignofficial/hope-ui-laravel-dashboard/archive/refs/heads/main.zip)
[Dowload from Github](https://github.com/tafcoder/sleek-dashboard/archive/refs/heads/master.zip)

[Download from Iqonic Design](https://iqonic.design/product/admin-templates/hope-ui-admin-free-open-source-bootstrap-admin-template/?utm_source=github&utm_medium=github-description&utm_campaign=open_source_github)
### Method 2: Using CDN
```
<link href="https://cdn.jsdelivr.net/gh/iqonicdesignofficial/hope-ui-design-system@main/dist/assets/css/hope-ui.min.css" rel="stylesheet"/>
```

### Method 2: Using NPM
```
<script src="https://cdn.jsdelivr.net/gh/iqonicdesignofficial/hope-ui-design-system@main/dist/assets/js/hope-ui.js"></script>
```
### Method 3: Using NPM
Start working with the design system
1. Install node_modules Run in terminal or CMD:
```
Expand Down Expand Up @@ -144,9 +152,11 @@ laravel
│ ├── Helpers
│ ├── Http
│ │ ├── Controllers
| | | └── Auth
│ | | ├── Controller.php
│ | | └── HomeController.php
| | | ├── Auth
| | | ├── security
│ | | ├── Controller.php
│ | | ├── UserController.php
│ | | └── HomeController.php
│ │ ├── Middleware
│ │ └── lRequests
│ ├── Model
Expand Down Expand Up @@ -200,9 +210,21 @@ laravel
│ │ ├── reboot/
│ │ ├── utilities/
│ │ └── _index.scss
│ ├── customizer
│ │ ├── components/
│ │ ├── layouts/
│ │ ├── menu-style/
│ │ ├── utilities/
│ │ ├── _components.scss
│ │ ├── _dark.scss
│ │ ├── _layouts.scss
│ │ ├── _reboot.scss
│ │ ├── _root.scss
│ │ └── _variables.scss
│ ├── rtl.scss
│ ├── dark.scss
│ ├── custom.scss
│ ├── customizer.scss
│ └── hope-ui.scss
├── resources
| ├── css
Expand All @@ -224,6 +246,7 @@ laravel
│ ├── table
│ ├── timeline
│ ├── ui
│ ├── role-permission
│ ├── dashboard.blade.php
| └── welcome.blade.php
├── route
Expand Down Expand Up @@ -261,7 +284,7 @@ laravel
- [Subscribe on Youtube](https://www.youtube.com/c/IqonicDesign)
- [Reach US](https://iqonic.design/contact-us/)
## Reporting Issues
Have a bug or a feature request? Raise a new issue at our [github](https://github.com/iqonicdesignofficial/hope-ui-laravel-dashboard/issues) support
Have a bug or a feature request? Raise a new issue at our [github](https://github.com/iqonicdesignofficial/hope-ui-design-system/issues) support

## Special Thanks
- [Bootstrap](https://getbootstrap.com/)
Expand All @@ -279,4 +302,4 @@ Have a bug or a feature request? Raise a new issue at our [github](https://githu
- [Instagram](https://www.instagram.com/iqonicdesign/)
- [Product Hunt](https://www.producthunt.com/posts/iqonic-design)
## Licensing
- Code and Documentation Copyright 2021 All Rights Reserved by [IQONIC](https://iqonic.design/?utm_source=github&utm_medium=github-description&utm_campaign=open_source_github) Design. Code released under the [MIT](https://iqonic.design/licenses/) License.
- Code and Documentation Copyright 2021 All Rights Reserved by [IQONIC](https://iqonic.design/?utm_source=github&utm_medium=github-description&utm_campaign=open_source_github) Design. Code released under the [MIT](https://iqonic.design/licenses/) License.
45 changes: 45 additions & 0 deletions app/Console/Commands/RefreshDatabase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class RefreshDatabase extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'refresh:database';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
if(ENV('IS_DEMO')){

\Artisan::call('migrate:fresh --seed');
}
}
}
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
$schedule->command('refresh:database')->twiceDaily(1, 13)->withoutOverlapping();
}

/**
Expand Down
129 changes: 129 additions & 0 deletions app/DataTables/UsersDataTable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?php

namespace App\DataTables;

use App\Models\User;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;

class UsersDataTable extends DataTable
{
/**
* Build DataTable class.
*
* @param mixed $query Results from query() method.
* @return \Yajra\DataTables\DataTableAbstract
*/
public function dataTable($query)
{
return datatables()
->eloquent($query)
->editColumn('userProfile.country', function($query) {
return $query->userProfile->country ?? '-';
})
->editColumn('userProfile.company_name', function($query) {
return $query->userProfile->company_name ?? '-';
})
->editColumn('status', function($query) {
$status = 'warning';
switch ($query->status) {
case 'active':
$status = 'primary';
break;
case 'inactive':
$status = 'danger';
break;
case 'banned':
$status = 'dark';
break;
}
return '<span class="text-capitalize badge bg-'.$status.'">'.$query->status.'</span>';
})
->editColumn('created_at', function($query) {
return date('Y/m/d',strtotime($query->created_at));
})
->filterColumn('full_name', function($query, $keyword) {
$sql = "CONCAT(users.first_name,' ',users.last_name) like ?";
return $query->whereRaw($sql, ["%{$keyword}%"]);
})
->filterColumn('userProfile.company_name', function($query, $keyword) {
return $query->orWhereHas('userProfile', function($q) use($keyword) {
$q->where('company_name', 'like', "%{$keyword}%");
});
})
->filterColumn('userProfile.country', function($query, $keyword) {
return $query->orWhereHas('userProfile', function($q) use($keyword) {
$q->where('country', 'like', "%{$keyword}%");
});
})
->addColumn('action', 'users.action')
->rawColumns(['action','status']);
}

/**
* Get query source of dataTable.
*
* @param \App\Models\User $model
* @return \Illuminate\Database\Eloquent\Builder
*/
public function query()
{
$model = User::query()->with('userProfile');
return $this->applyScopes($model);
}

/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('dataTable')
->columns($this->getColumns())
->minifiedAjax()
->dom('<"row align-items-center"<"col-md-2" l><"col-md-6" B><"col-md-4"f>><"table-responsive my-3" rt><"row align-items-center" <"col-md-6" i><"col-md-6" p>><"clear">')

->parameters([
"processing" => true,
"autoWidth" => false,
]);
}

/**
* Get columns.
*
* @return array
*/
protected function getColumns()
{
return [
['data' => 'id', 'name' => 'id', 'title' => 'id'],
['data' => 'full_name', 'name' => 'full_name', 'title' => 'FULL NAME', 'orderable' => false],
['data' => 'phone_number', 'name' => 'phone_number', 'title' => 'Phone Number'],
['data' => 'email', 'name' => 'email', 'title' => 'Email'],
['data' => 'userProfile.country', 'name' => 'userProfile.country', 'title' => 'Country'],
['data' => 'status', 'name' => 'status', 'title' => 'Status'],
['data' => 'userProfile.company_name', 'name' => 'userProfile.company_name', 'title' => 'Company'],
['data' => 'created_at', 'name' => 'created_at', 'title' => 'Join Date'],
Column::computed('action')
->exportable(false)
->printable(false)
->searchable(false)
->width(60)
->addClass('text-center hide-search'),
];
}

/**
* Get filename for export.
*
* @return string
*/
protected function filename()
{
return 'Users_' . date('YmdHis');
}
}
67 changes: 67 additions & 0 deletions app/Helpers/AuthHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

namespace App\Helpers;

use Exception;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Auth;

class AuthHelper {
public static function authSession(){
$session = new \App\Models\User;
if(Session::has('auth_user')){
$session = Session::get('auth_user');
}else{
$user = Auth::user();
Session::put('auth_user',$user);
$session = Session::get('auth_user');
}
return $session;
}

public static function checkMenuRoleAndPermission($menu)
{
if (Auth::check()) {
if ($menu->data('role') == null && auth()->user()->hasRole('admin')) {
return true;
}

if($menu->data('permission') == null && $menu->data('role') == null) {
return true;
}

if($menu->data('role') != null) {
if(auth()->user()->hasAnyRole(explode(',', $menu->data('role')))) {
return true;
}
}

if($menu->data('permission') != null) {
if(auth()->user()->can($menu->data('permission')) ) {
return true;
}
}
}

return false;
}

public static function checkRolePermission($role,$permission){
try{
if($role->hasPermissionTo($permission)){
return true;
}
return false;
}catch (Exception $e){
return false;
}
}

public static function demoUserPermission(){
if(Auth::user()->hasRole('demo_admin')){
return true;
}else{
return false;
}
}
}
Loading

0 comments on commit 2cbba5b

Please sign in to comment.