Unverified Commit 781f175d authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #231 from viralsolani/develop

Merge Develop Branch
parents 9f05ba48 5d765f2a
......@@ -21,6 +21,11 @@ CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
#Session Timeout
SESSION_TIMEOUT_STATUS=true
#In Seconds
SESSION_TIMEOUT=600
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
......@@ -28,6 +33,8 @@ REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_FROM=viral.solani@gmail.com
MAIL_FROM_NAME=Admin
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
......
......@@ -27,6 +27,8 @@ Give your project a Head Start by using [laravel-adminpanel](https://github.com/
## Built-in Laravel Boilerplate Module Generator
It gives you the ability to create a module using a sweet GUI, where you put in the Module Name and it will generate all the necessary files for you, like Model, Traits, Relationship, Migration, Controllers, Views and routes. So when you are done creating a module, you can directly go to the route generated and see your new module. Since, this does not have the ability to generate table fields for now, so you have to write the migration file that is generated and run a manual php artisan migrate command, and you are good to go.
We are using the module generator as a package, you can find it here: [Module Generator For Laravel Adminpanel](https://github.com/bvipul/generator).
## Installation
Please check the official laravel installation guide for server requirements before you start. [Official Documentation](https://laravel.com/docs/5.6/installation#installation)
......
<?php
namespace App\Helpers\Macros;
use App\Helpers\Macros\Traits\Dropdowns;
use Collective\Html\FormBuilder;
/**
* Class Macros.
*/
class Macros extends FormBuilder
{
use Dropdowns;
}
<?php
namespace App\Helpers\Macros\Traits;
/**
* Class Dropdowns.
*/
trait Dropdowns
{
/**
* Use this to set the default country state type for the shorthand method.
*
* @param $name
* @param null $selected
* @param array $options
*
* @return string
*/
public function selectState($name, $selected = null, $options = [])
{
return $this->selectStateUS($name, $selected, $options);
}
/**
* @param $name
* @param null $selected
* @param array $options
*
* @return string
*/
public function selectStateUS($name, $selected = null, $options = [])
{
$list = [
'' => 'Select One...',
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
'DE' => 'Delaware',
'DC' => 'District of Columbia',
'FL' => 'Florida',
'GA' => 'Georgia',
'HI' => 'Hawaii',
'ID' => 'Idaho',
'IL' => 'Illinois',
'IN' => 'Indiana',
'IA' => 'Iowa',
'KS' => 'Kansas',
'KY' => 'Kentucky',
'LA' => 'Louisiana',
'ME' => 'Maine',
'MD' => 'Maryland',
'MA' => 'Massachusetts',
'MI' => 'Michigan',
'MN' => 'Minnesota',
'MS' => 'Mississippi',
'MO' => 'Missouri',
'MT' => 'Montana',
'NE' => 'Nebraska',
'NV' => 'Nevada',
'NH' => 'New Hampshire',
'NJ' => 'New Jersey',
'NM' => 'New Mexico',
'NY' => 'New York',
'NC' => 'North Carolina',
'ND' => 'North Dakota',
'OH' => 'Ohio',
'OK' => 'Oklahoma',
'OR' => 'Oregon',
'PA' => 'Pennsylvania',
'RI' => 'Rhode Island',
'SC' => 'South Carolina',
'SD' => 'South Dakota',
'TN' => 'Tennessee',
'TX' => 'Texas',
'UT' => 'Utah',
'VT' => 'Vermont',
'VA' => 'Virginia',
'WA' => 'Washington',
'WV' => 'West Virginia',
'WI' => 'Wisconsin',
'WY' => 'Wyoming',
];
return $this->select($name, $list, $selected, $options);
}
/**
* @param $name
* @param null $selected
* @param array $options
*
* @return mixed
*/
public function selectStateUSOutlyingTerritories($name, $selected = null, $options = [])
{
$list = [
'' => 'Select One...',
'AS' => 'American Samoa',
'GU' => 'Guam',
'MP' => 'Northern Mariana Islands',
'PR' => 'Puerto Rico',
'UM' => 'United States Minor Outlying Islands',
'VI' => 'Virgin Islands',
];
return $this->select($name, $list, $selected, $options);
}
/**
* @param $name
* @param null $selected
* @param array $options
*
* @return mixed
*/
public function selectStateUSArmedForces($name, $selected = null, $options = [])
{
$list = [
'' => 'Select One...',
'AA' => 'Armed Forces Americas',
'AP' => 'Armed Forces Pacific',
'AE' => 'Armed Forces Others',
];
return $this->select($name, $list, $selected, $options);
}
/**
* @param $name
* @param null $selected
* @param array $options
*
* @return mixed
*/
public function selectCanadaTerritories($name, $selected = null, $options = [])
{
$list = [
'' => 'Select One...',
'AB' => 'Alberta',
'BC' => 'British Columbia',
'MB' => 'Manitoba',
'NB' => 'New Brunswick',
'NL' => 'Newfoundland and Labrador',
'NS' => 'Nova Scotia',
'ON' => 'Ontario',
'PE' => 'Prince Edward Island',
'QC' => 'Quebec',
'SK' => 'Saskatchewan',
'NT' => 'Northwest Territories',
'NU' => 'Nunavut',
'YT' => 'Yukon',
];
return $this->select($name, $list, $selected, $options);
}
/**
* @param $name
* @param null $selected
* @param array $options
*
* @return mixed
*/
public function selectStateMexico($name, $selected = null, $options = [])
{
$list = [
'' => 'Select One...',
'DIF' => 'Distrito Federal',
'AGS' => 'Aguascalientes',
'BCN' => 'Baja California',
'BCS' => 'Baja California Sur',
'CAM' => 'Campeche',
'CHP' => 'Chiapas',
'CHI' => 'Chihuahua',
'COA' => 'Coahuila',
'COL' => 'Colima',
'DUR' => 'Durango',
'GTO' => 'Guanajuato',
'GRO' => 'Guerrero',
'HGO' => 'Hidalgo',
'JAL' => 'Jalisco',
'MEX' => 'Mexico',
'MIC' => 'Michoacan',
'MOR' => 'Morelos',
'NAY' => 'Nayarit',
'NLE' => 'Nuevo Le&oacute;n',
'OAX' => 'Oaxaca',
'PUE' => 'Puebla',
'QRO' => 'Queretaro',
'ROO' => 'Quintana Roo',
'SLP' => 'San Luis Potos&iacute;',
'SIN' => 'Sinaloa',
'SON' => 'Sonora',
'TAB' => 'Tabasco',
'TAM' => 'Tamaulipas',
'TLX' => 'Tlaxcala',
'VER' => 'Veracruz',
'YUC' => 'Yucatan',
'ZAC' => 'Zacatecas',
];
return $this->select($name, $list, $selected, $options);
}
/**
* Use this to set the default country dropdown type for the shorthand method.
*
* @param $name
* @param null $selected
* @param array $options
*
* @return string
*/
public function selectCountry($name, $selected = null, $options = [])
{
return $this->selectCountryAlpha2($name, $selected, $options);
}
/**
* @param $name
* @param null $selected
* @param array $options
*
* @return mixed
*/
public function selectCountryAlpha($name, $selected = null, $options = [])
{
$list = [
'' => 'Select One...',
'ISO 3166-2:AF' => 'Afghanistan',
'ISO 3166-2:AX' => 'Åland Islands',
'ISO 3166-2:AL' => 'Albania',
'ISO 3166-2:DZ' => 'Algeria',
'ISO 3166-2:AS' => 'American Samoa',
'ISO 3166-2:AD' => 'Andorra',
'ISO 3166-2:AO' => 'Angola',
'ISO 3166-2:AI' => 'Anguilla',
'ISO 3166-2:AQ' => 'Antarctica',
'ISO 3166-2:AG' => 'Antigua and Barbuda',
'ISO 3166-2:AR' => 'Argentina',
'ISO 3166-2:AM' => 'Armenia',
'ISO 3166-2:AW' => 'Aruba',
'ISO 3166-2:AU' => 'Australia',
'ISO 3166-2:AT' => 'Austria',
'ISO 3166-2:AZ' => 'Azerbaijan',
'ISO 3166-2:BS' => 'Bahamas',
'ISO 3166-2:BH' => 'Bahrain',
'ISO 3166-2:BD' => 'Bangladesh',
'ISO 3166-2:BB' => 'Barbados',
'ISO 3166-2:BY' => 'Belarus',
'ISO 3166-2:BE' => 'Belgium',
'ISO 3166-2:BZ' => 'Belize',
'ISO 3166-2:BJ' => 'Benin',
'ISO 3166-2:BM' => 'Bermuda',
'ISO 3166-2:BT' => 'Bhutan',
'ISO 3166-2:BO' => 'Bolivia, Plurinational State of',
'ISO 3166-2:BQ' => 'Bonaire, Sint Eustatius and Saba',
'ISO 3166-2:BA' => 'Bosnia and Herzegovina',
'ISO 3166-2:BW' => 'Botswana',
'ISO 3166-2:BV' => 'Bouvet Island',
'ISO 3166-2:BR' => 'Brazil',
'ISO 3166-2:IO' => 'British Indian Ocean Territory',
'ISO 3166-2:BN' => 'Brunei Darussalam',
'ISO 3166-2:BG' => 'Bulgaria',
'ISO 3166-2:BF' => 'Burkina Faso',
'ISO 3166-2:BI' => 'Burundi',
'ISO 3166-2:KH' => 'Cambodia',
'ISO 3166-2:CM' => 'Cameroon',
'ISO 3166-2:CA' => 'Canada',
'ISO 3166-2:CV' => 'Cape Verde',
'ISO 3166-2:KY' => 'Cayman Islands',
'ISO 3166-2:CF' => 'Central African Republic',
'ISO 3166-2:TD' => 'Chad',
'ISO 3166-2:CL' => 'Chile',
'ISO 3166-2:CN' => 'China',
'ISO 3166-2:CX' => 'Christmas Island',
'ISO 3166-2:CC' => 'Cocos (Keeling) Islands',
'ISO 3166-2:CO' => 'Colombia',
'ISO 3166-2:KM' => 'Comoros',
'ISO 3166-2:CG' => 'Congo',
'ISO 3166-2:CD' => 'Congo, the Democratic Republic of the',
'ISO 3166-2:CK' => 'Cook Islands',
'ISO 3166-2:CR' => 'Costa Rica',
'ISO 3166-2:CI' => 'Côte d\Ivoire',
'ISO 3166-2:HR' => 'Croatia',
'ISO 3166-2:CU' => 'Cuba',
'ISO 3166-2:CW' => 'Curaçao',
'ISO 3166-2:CY' => 'Cyprus',
'ISO 3166-2:CZ' => 'Czech Republic',
'ISO 3166-2:DK' => 'Denmark',
'ISO 3166-2:DJ' => 'Djibouti',
'ISO 3166-2:DM' => 'Dominica',
'ISO 3166-2:DO' => 'Dominican Republic',
'ISO 3166-2:EC' => 'Ecuador',
'ISO 3166-2:EG' => 'Egypt',
'ISO 3166-2:SV' => 'El Salvador',
'ISO 3166-2:GQ' => 'Equatorial Guinea',
'ISO 3166-2:ER' => 'Eritrea',
'ISO 3166-2:EE' => 'Estonia',
'ISO 3166-2:ET' => 'Ethiopia',
'ISO 3166-2:FK' => 'Falkland Islands (Malvinas)',
'ISO 3166-2:FO' => 'Faroe Islands',
'ISO 3166-2:FJ' => 'Fiji',
'ISO 3166-2:FI' => 'Finland',
'ISO 3166-2:FR' => 'France',
'ISO 3166-2:GF' => 'French Guiana',
'ISO 3166-2:PF' => 'French Polynesia',
'ISO 3166-2:TF' => 'French Southern Territories',
'ISO 3166-2:GA' => 'Gabon',
'ISO 3166-2:GM' => 'Gambia',
'ISO 3166-2:GE' => 'Georgia',
'ISO 3166-2:DE' => 'Germany',
'ISO 3166-2:GH' => 'Ghana',
'ISO 3166-2:GI' => 'Gibraltar',
'ISO 3166-2:GR' => 'Greece',
'ISO 3166-2:GL' => 'Greenland',
'ISO 3166-2:GD' => 'Grenada',
'ISO 3166-2:GP' => 'Guadeloupe',
'ISO 3166-2:GU' => 'Guam',
'ISO 3166-2:GT' => 'Guatemala',
'ISO 3166-2:GG' => 'Guernsey',
'ISO 3166-2:GN' => 'Guinea',
'ISO 3166-2:GW' => 'Guinea-Bissau',
'ISO 3166-2:GY' => 'Guyana',
'ISO 3166-2:HT' => 'Haiti',
'ISO 3166-2:HM' => 'Heard Island and McDonald Islands',
'ISO 3166-2:VA' => 'Holy See (Vatican City State)',
'ISO 3166-2:HN' => 'Honduras',
'ISO 3166-2:HK' => 'Hong Kong',
'ISO 3166-2:HU' => 'Hungary',
'ISO 3166-2:IS' => 'Iceland',
'ISO 3166-2:IN' => 'India',
'ISO 3166-2:ID' => 'Indonesia',
'ISO 3166-2:IR' => 'Iran, Islamic Republic of',
'ISO 3166-2:IQ' => 'Iraq',
'ISO 3166-2:IE' => 'Ireland',
'ISO 3166-2:IM' => 'Isle of Man',
'ISO 3166-2:IL' => 'Israel',
'ISO 3166-2:IT' => 'Italy',
'ISO 3166-2:JM' => 'Jamaica',
'ISO 3166-2:JP' => 'Japan',
'ISO 3166-2:JE' => 'Jersey',
'ISO 3166-2:JO' => 'Jordan',
'ISO 3166-2:KZ' => 'Kazakhstan',
'ISO 3166-2:KE' => 'Kenya',
'ISO 3166-2:KI' => 'Kiribati',
'ISO 3166-2:KP' => 'Korea, Democratic People\'s Republic of',
'ISO 3166-2:KR' => 'Korea, Republic of',
'ISO 3166-2:KW' => 'Kuwait',
'ISO 3166-2:KG' => 'Kyrgyzstan',
'ISO 3166-2:LA' => 'Lao People\'s Democratic Republic',
'ISO 3166-2:LV' => 'Latvia',
'ISO 3166-2:LB' => 'Lebanon',
'ISO 3166-2:LS' => 'Lesotho',
'ISO 3166-2:LR' => 'Liberia',
'ISO 3166-2:LY' => 'Libya',
'ISO 3166-2:LI' => 'Liechtenstein',
'ISO 3166-2:LT' => 'Lithuania',
'ISO 3166-2:LU' => 'Luxembourg',
'ISO 3166-2:MO' => 'Macao',
'ISO 3166-2:MK' => 'Macedonia, the former Yugoslav Republic of',
'ISO 3166-2:MG' => 'Madagascar',
'ISO 3166-2:MW' => 'Malawi',
'ISO 3166-2:MY' => 'Malaysia',
'ISO 3166-2:MV' => 'Maldives',
'ISO 3166-2:ML' => 'Mali',
'ISO 3166-2:MT' => 'Malta',
'ISO 3166-2:MH' => 'Marshall Islands',
'ISO 3166-2:MQ' => 'Martinique',
'ISO 3166-2:MR' => 'Mauritania',
'ISO 3166-2:MU' => 'Mauritius',
'ISO 3166-2:YT' => 'Mayotte',
'ISO 3166-2:MX' => 'Mexico',
'ISO 3166-2:FM' => 'Micronesia, Federated States of',
'ISO 3166-2:MD' => 'Moldova, Republic of',
'ISO 3166-2:MC' => 'Monaco',
'ISO 3166-2:MN' => 'Mongolia',
'ISO 3166-2:ME' => 'Montenegro',
'ISO 3166-2:MS' => 'Montserrat',
'ISO 3166-2:MA' => 'Morocco',
'ISO 3166-2:MZ' => 'Mozambique',
'ISO 3166-2:MM' => 'Myanmar',
'ISO 3166-2:NA' => 'Namibia',
'ISO 3166-2:NR' => 'Nauru',
'ISO 3166-2:NP' => 'Nepal',
'ISO 3166-2:NL' => 'Netherlands',
'ISO 3166-2:NC' => 'New Caledonia',
'ISO 3166-2:NZ' => 'New Zealand',
'ISO 3166-2:NI' => 'Nicaragua',
'ISO 3166-2:NE' => 'Niger',
'ISO 3166-2:NG' => 'Nigeria',
'ISO 3166-2:NU' => 'Niue',
'ISO 3166-2:NF' => 'Norfolk Island',
'ISO 3166-2:MP' => 'Northern Mariana Islands',
'ISO 3166-2:NO' => 'Norway',
'ISO 3166-2:OM' => 'Oman',
'ISO 3166-2:PK' => 'Pakistan',
'ISO 3166-2:PW' => 'Palau',
'ISO 3166-2:PS' => 'Palestinian Territory, Occupied',
'ISO 3166-2:PA' => 'Panama',
'ISO 3166-2:PG' => 'Papua New Guinea',
'ISO 3166-2:PY' => 'Paraguay',
'ISO 3166-2:PE' => 'Peru',
'ISO 3166-2:PH' => 'Philippines',
'ISO 3166-2:PN' => 'Pitcairn',
'ISO 3166-2:PL' => 'Poland',
'ISO 3166-2:PT' => 'Portugal',
'ISO 3166-2:PR' => 'Puerto Rico',
'ISO 3166-2:QA' => 'Qatar',
'ISO 3166-2:RE' => 'Réunion',
'ISO 3166-2:RO' => 'Romania',
'ISO 3166-2:RU' => 'Russian Federation',
'ISO 3166-2:RW' => 'Rwanda',
'ISO 3166-2:BL' => 'Saint Barthélemy',
'ISO 3166-2:SH' => 'Saint Helena, Ascension and Tristan da Cunha',
'ISO 3166-2:KN' => 'Saint Kitts and Nevis',
'ISO 3166-2:LC' => 'Saint Lucia',
'ISO 3166-2:MF' => 'Saint Martin (French part)',
'ISO 3166-2:PM' => 'Saint Pierre and Miquelon',
'ISO 3166-2:VC' => 'Saint Vincent and the Grenadines',
'ISO 3166-2:WS' => 'Samoa',
'ISO 3166-2:SM' => 'San Marino',
'ISO 3166-2:ST' => 'Sao Tome and Principe',
'ISO 3166-2:SA' => 'Saudi Arabia',
'ISO 3166-2:SN' => 'Senegal',
'ISO 3166-2:RS' => 'Serbia',
'ISO 3166-2:SC' => 'Seychelles',
'ISO 3166-2:SL' => 'Sierra Leone',
'ISO 3166-2:SG' => 'Singapore',
'ISO 3166-2:SX' => 'Sint Maarten (Dutch part)',
'ISO 3166-2:SK' => 'Slovakia',
'ISO 3166-2:SI' => 'Slovenia',
'ISO 3166-2:SB' => 'Solomon Islands',
'ISO 3166-2:SO' => 'Somalia',
'ISO 3166-2:ZA' => 'South Africa',
'ISO 3166-2:GS' => 'South Georgia and the South Sandwich Islands',
'ISO 3166-2:SS' => 'South Sudan',
'ISO 3166-2:ES' => 'Spain',
'ISO 3166-2:LK' => 'Sri Lanka',
'ISO 3166-2:SD' => 'Sudan',
'ISO 3166-2:SR' => 'Suriname',
'ISO 3166-2:SJ' => 'Svalbard and Jan Mayen',
'ISO 3166-2:SZ' => 'Swaziland',
'ISO 3166-2:SE' => 'Sweden',
'ISO 3166-2:CH' => 'Switzerland',
'ISO 3166-2:SY' => 'Syrian Arab Republic',
'ISO 3166-2:TW' => 'Taiwan, Province of China',
'ISO 3166-2:TJ' => 'Tajikistan',
'ISO 3166-2:TZ' => 'Tanzania, United Republic of',
'ISO 3166-2:TH' => 'Thailand',
'ISO 3166-2:TL' => 'Timor-Leste',
'ISO 3166-2:TG' => 'Togo',
'ISO 3166-2:TK' => 'Tokelau',
'ISO 3166-2:TO' => 'Tonga',
'ISO 3166-2:TT' => 'Trinidad and Tobago',
'ISO 3166-2:TN' => 'Tunisia',
'ISO 3166-2:TR' => 'Turkey',
'ISO 3166-2:TM' => 'Turkmenistan',
'ISO 3166-2:TC' => 'Turks and Caicos Islands',
'ISO 3166-2:TV' => 'Tuvalu',
'ISO 3166-2:UG' => 'Uganda',
'ISO 3166-2:UA' => 'Ukraine',
'ISO 3166-2:AE' => 'United Arab Emirates',
'ISO 3166-2:GB' => 'United Kingdom',
'ISO 3166-2:US' => 'United States',
'ISO 3166-2:UM' => 'United States Minor Outlying Islands',
'ISO 3166-2:UY' => 'Uruguay',
'ISO 3166-2:UZ' => 'Uzbekistan',
'ISO 3166-2:VU' => 'Vanuatu',
'ISO 3166-2:VE' => 'Venezuela, Bolivarian Republic of',
'ISO 3166-2:VN' => 'Viet Nam',
'ISO 3166-2:VG' => 'Virgin Islands, British',
'ISO 3166-2:VI' => 'Virgin Islands, U.S.',
'ISO 3166-2:WF' => 'Wallis and Futuna',
'ISO 3166-2:EH' => 'Western Sahara',
'ISO 3166-2:YE' => 'Yemen',
'ISO 3166-2:ZM' => 'Zambia',
'ISO 3166-2:ZW' => 'Zimbabwe',
];
return $this->select($name, $list, $selected, $options);
}
/**
* @param $name
* @param null $selected
* @param array $options
*
* @return string
*/
public function selectCountryAlpha2($name, $selected = null, $options = [])
{
$list = [
'' => 'Select One...',
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarctica',
'AG' => 'Antigua and Barbuda',
'AR' => 'Argentina',
'AM' => 'Armenia',
'AW' => 'Aruba',
'AU' => 'Australia',
'AT' => 'Austria',
'AZ' => 'Azerbaijan',
'BS' => 'Bahamas',
'BH' => 'Bahrain',
'BD' => 'Bangladesh',
'BB' => 'Barbados',
'BY' => 'Belarus',
'BE' => 'Belgium',
'BZ' => 'Belize',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BT' => 'Bhutan',
'BO' => 'Bolivia',
'BA' => 'Bosnia and Herzegovina',
'BW' => 'Botswana',
'BV' => 'Bouvet Island',
'BR' => 'Brazil',
'IO' => 'British Indian Ocean Territory',
'BN' => 'Brunei Darussalam',
'BG' => 'Bulgaria',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'KH' => 'Cambodia',
'CM' => 'Cameroon',
'CA' => 'Canada',
'CV' => 'Cape Verde',
'KY' => 'Cayman Islands',
'CF' => 'Central African Republic',
'TD' => 'Chad',
'CL' => 'Chile',
'CN' => 'China',
'CX' => 'Christmas Island',
'CC' => 'Cocos (Keeling) Islands',
'CO' => 'Colombia',
'KM' => 'Comoros',
'CG' => 'Congo',
'CD' => 'Congo, The Democratic Republic of The',
'CK' => 'Cook Islands',
'CR' => 'Costa Rica',
'CI' => 'Cote D\'ivoire',
'HR' => 'Croatia',
'CU' => 'Cuba',
'CY' => 'Cyprus',
'CZ' => 'Czech Republic',
'DK' => 'Denmark',
'DJ' => 'Djibouti',
'DM' => 'Dominica',
'DO' => 'Dominican Republic',
'EC' => 'Ecuador',
'EG' => 'Egypt',
'SV' => 'El Salvador',
'GQ' => 'Equatorial Guinea',
'ER' => 'Eritrea',
'EE' => 'Estonia',
'ET' => 'Ethiopia',
'FK' => 'Falkland Islands (Malvinas)',
'FO' => 'Faroe Islands',
'FJ' => 'Fiji',
'FI' => 'Finland',
'FR' => 'France',
'GF' => 'French Guiana',
'PF' => 'French Polynesia',
'TF' => 'French Southern Territories',
'GA' => 'Gabon',
'GM' => 'Gambia',
'GE' => 'Georgia',
'DE' => 'Germany',
'GH' => 'Ghana',
'GI' => 'Gibraltar',
'GR' => 'Greece',
'GL' => 'Greenland',
'GD' => 'Grenada',
'GP' => 'Guadeloupe',
'GU' => 'Guam',
'GT' => 'Guatemala',
'GG' => 'Guernsey',
'GN' => 'Guinea',
'GW' => 'Guinea-bissau',
'GY' => 'Guyana',
'HT' => 'Haiti',
'HM' => 'Heard Island and Mcdonald Islands',
'VA' => 'Holy See (Vatican City State)',
'HN' => 'Honduras',
'HK' => 'Hong Kong',
'HU' => 'Hungary',
'IS' => 'Iceland',
'IN' => 'India',
'ID' => 'Indonesia',
'IR' => 'Iran, Islamic Republic of',
'IQ' => 'Iraq',
'IE' => 'Ireland',
'IM' => 'Isle of Man',
'IL' => 'Israel',
'IT' => 'Italy',
'JM' => 'Jamaica',
'JP' => 'Japan',
'JE' => 'Jersey',
'JO' => 'Jordan',
'KZ' => 'Kazakhstan',
'KE' => 'Kenya',
'KI' => 'Kiribati',
'KP' => 'Korea, Democratic People\'s Republic of',
'KR' => 'Korea, Republic of',
'KW' => 'Kuwait',
'KG' => 'Kyrgyzstan',
'LA' => 'Lao People\'s Democratic Republic',
'LV' => 'Latvia',
'LB' => 'Lebanon',
'LS' => 'Lesotho',
'LR' => 'Liberia',
'LY' => 'Libyan Arab Jamahiriya',
'LI' => 'Liechtenstein',
'LT' => 'Lithuania',
'LU' => 'Luxembourg',
'MO' => 'Macao',
'MK' => 'Macedonia, The Former Yugoslav Republic of',
'MG' => 'Madagascar',
'MW' => 'Malawi',
'MY' => 'Malaysia',
'MV' => 'Maldives',
'ML' => 'Mali',
'MT' => 'Malta',
'MH' => 'Marshall Islands',
'MQ' => 'Martinique',
'MR' => 'Mauritania',
'MU' => 'Mauritius',
'YT' => 'Mayotte',
'MX' => 'Mexico',
'FM' => 'Micronesia, Federated States of',
'MD' => 'Moldova, Republic of',
'MC' => 'Monaco',
'MN' => 'Mongolia',
'ME' => 'Montenegro',
'MS' => 'Montserrat',
'MA' => 'Morocco',
'MZ' => 'Mozambique',
'MM' => 'Myanmar',
'NA' => 'Namibia',
'NR' => 'Nauru',
'NP' => 'Nepal',
'NL' => 'Netherlands',
'AN' => 'Netherlands Antilles',
'NC' => 'New Caledonia',
'NZ' => 'New Zealand',
'NI' => 'Nicaragua',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'NF' => 'Norfolk Island',
'MP' => 'Northern Mariana Islands',
'NO' => 'Norway',
'OM' => 'Oman',
'PK' => 'Pakistan',
'PW' => 'Palau',
'PS' => 'Palestinian Territory, Occupied',
'PA' => 'Panama',
'PG' => 'Papua New Guinea',
'PY' => 'Paraguay',
'PE' => 'Peru',
'PH' => 'Philippines',
'PN' => 'Pitcairn',
'PL' => 'Poland',
'PT' => 'Portugal',
'PR' => 'Puerto Rico',
'QA' => 'Qatar',
'RE' => 'Reunion',
'RO' => 'Romania',
'RU' => 'Russian Federation',
'RW' => 'Rwanda',
'SH' => 'Saint Helena',
'KN' => 'Saint Kitts and Nevis',
'LC' => 'Saint Lucia',
'PM' => 'Saint Pierre and Miquelon',
'VC' => 'Saint Vincent and The Grenadines',
'WS' => 'Samoa',
'SM' => 'San Marino',
'ST' => 'Sao Tome and Principe',
'SA' => 'Saudi Arabia',
'SN' => 'Senegal',
'RS' => 'Serbia',
'SC' => 'Seychelles',
'SL' => 'Sierra Leone',
'SG' => 'Singapore',
'SK' => 'Slovakia',
'SI' => 'Slovenia',
'SB' => 'Solomon Islands',
'SO' => 'Somalia',
'ZA' => 'South Africa',
'GS' => 'South Georgia and The South Sandwich Islands',
'ES' => 'Spain',
'LK' => 'Sri Lanka',
'SD' => 'Sudan',
'SR' => 'Suriname',
'SJ' => 'Svalbard and Jan Mayen',
'SZ' => 'Swaziland',
'SE' => 'Sweden',
'CH' => 'Switzerland',
'SY' => 'Syrian Arab Republic',
'TW' => 'Taiwan, Province of China',
'TJ' => 'Tajikistan',
'TZ' => 'Tanzania, United Republic of',
'TH' => 'Thailand',
'TL' => 'Timor-leste',
'TG' => 'Togo',
'TK' => 'Tokelau',
'TO' => 'Tonga',
'TT' => 'Trinidad and Tobago',
'TN' => 'Tunisia',
'TR' => 'Turkey',
'TM' => 'Turkmenistan',
'TC' => 'Turks and Caicos Islands',
'TV' => 'Tuvalu',
'UG' => 'Uganda',
'UA' => 'Ukraine',
'AE' => 'United Arab Emirates',
'GB' => 'United Kingdom',
'US' => 'United States',
'UM' => 'United States Minor Outlying Islands',
'UY' => 'Uruguay',
'UZ' => 'Uzbekistan',
'VU' => 'Vanuatu',
'VE' => 'Venezuela',
'VN' => 'Viet Nam',
'VG' => 'Virgin Islands, British',
'VI' => 'Virgin Islands, U.S.',
'WF' => 'Wallis and Futuna',
'EH' => 'Western Sahara',
'YE' => 'Yemen',
'ZM' => 'Zambia',
'ZW' => 'Zimbabwe',
];
return $this->select($name, $list, $selected, $options);
}
/**
* @param $name
* @param null $selected
* @param array $options
*
* @return string
*/
public function selectCountryAlpha3($name, $selected = null, $options = [])
{
$list = [
'' => 'Select One...',
'AFG' => 'Afghanistan',
'ALA' => 'Åland Islands',
'ALB' => 'Albania',
'DZA' => 'Algeria',
'ASM' => 'American Samoa',
'AND' => 'Andorra',
'AGO' => 'Angola',
'AIA' => 'Anguilla',
'ATA' => 'Antarctica',
'ATG' => 'Antigua and Barbuda',
'ARG' => 'Argentina',
'ARM' => 'Armenia',
'ABW' => 'Aruba',
'AUS' => 'Australia',
'AUT' => 'Austria',
'AZE' => 'Azerbaijan',
'BHS' => 'Bahamas',
'BHR' => 'Bahrain',
'BGD' => 'Bangladesh',
'BRB' => 'Barbados',
'BLR' => 'Belarus',
'BEL' => 'Belgium',
'BLZ' => 'Belize',
'BEN' => 'Benin',
'BMU' => 'Bermuda',
'BTN' => 'Bhutan',
'BOL' => 'Bolivia, Plurinational State of',
'BES' => 'Bonaire, Sint Eustatius and Saba',
'BIH' => 'Bosnia and Herzegovina',
'BWA' => 'Botswana',
'BVT' => 'Bouvet Island',
'BRA' => 'Brazil',
'IOT' => 'British Indian Ocean Territory',
'BRN' => 'Brunei Darussalam',
'BGR' => 'Bulgaria',
'BFA' => 'Burkina Faso',
'BDI' => 'Burundi',
'KHM' => 'Cambodia',
'CMR' => 'Cameroon',
'CAN' => 'Canada',
'CPV' => 'Cape Verde',
'CYM' => 'Cayman Islands',
'CAF' => 'Central African Republic',
'TCD' => 'Chad',
'CHL' => 'Chile',
'CHN' => 'China',
'CXR' => 'Christmas Island',
'CCK' => 'Cocos (Keeling) Islands',
'COL' => 'Colombia',
'COM' => 'Comoros',
'COG' => 'Congo',
'COD' => 'Congo, the Democratic Republic of the',
'COK' => 'Cook Islands',
'CRI' => 'Costa Rica',
'CIV' => 'Côte d\'Ivoire',
'HRV' => 'Croatia',
'CUB' => 'Cuba',
'CUW' => 'Curaçao',
'CYP' => 'Cyprus',
'CZE' => 'Czech Republic',
'DNK' => 'Denmark',
'DJI' => 'Djibouti',
'DMA' => 'Dominica',
'DOM' => 'Dominican Republic',
'ECU' => 'Ecuador',
'EGY' => 'Egypt',
'SLV' => 'El Salvador',
'GNQ' => 'Equatorial Guinea',
'ERI' => 'Eritrea',
'EST' => 'Estonia',
'ETH' => 'Ethiopia',
'FLK' => 'Falkland Islands (Malvinas)',
'FRO' => 'Faroe Islands',
'FJI' => 'Fiji',
'FIN' => 'Finland',
'FRA' => 'France',
'GUF' => 'French Guiana',
'PYF' => 'French Polynesia',
'ATF' => 'French Southern Territories',
'GAB' => 'Gabon',
'GMB' => 'Gambia',
'GEO' => 'Georgia',
'DEU' => 'Germany',
'GHA' => 'Ghana',
'GIB' => 'Gibraltar',
'GRC' => 'Greece',
'GRL' => 'Greenland',
'GRD' => 'Grenada',
'GLP' => 'Guadeloupe',
'GUM' => 'Guam',
'GTM' => 'Guatemala',
'GGY' => 'Guernsey',
'GIN' => 'Guinea',
'GNB' => 'Guinea-Bissau',
'GUY' => 'Guyana',
'HTI' => 'Haiti',
'HMD' => 'Heard Island and McDonald Islands',
'VAT' => 'Holy See (Vatican City State)',
'HND' => 'Honduras',
'HKG' => 'Hong Kong',
'HUN' => 'Hungary',
'ISL' => 'Iceland',
'IND' => 'India',
'IDN' => 'Indonesia',
'IRN' => 'Iran, Islamic Republic of',
'IRQ' => 'Iraq',
'IRL' => 'Ireland',
'IMN' => 'Isle of Man',
'ISR' => 'Israel',
'ITA' => 'Italy',
'JAM' => 'Jamaica',
'JPN' => 'Japan',
'JEY' => 'Jersey',
'JOR' => 'Jordan',
'KAZ' => 'Kazakhstan',
'KEN' => 'Kenya',
'KIR' => 'Kiribati',
'PRK' => 'Korea, Democratic People\'s Republic of',
'KOR' => 'Korea, Republic of',
'KWT' => 'Kuwait',
'KGZ' => 'Kyrgyzstan',
'LAO' => 'Lao People\'s Democratic Republic',
'LVA' => 'Latvia',
'LBN' => 'Lebanon',
'LSO' => 'Lesotho',
'LBR' => 'Liberia',
'LBY' => 'Libya',
'LIE' => 'Liechtenstein',
'LTU' => 'Lithuania',
'LUX' => 'Luxembourg',
'MAC' => 'Macao',
'MKD' => 'Macedonia, the former Yugoslav Republic of',
'MDG' => 'Madagascar',
'MWI' => 'Malawi',
'MYS' => 'Malaysia',
'MDV' => 'Maldives',
'MLI' => 'Mali',
'MLT' => 'Malta',
'MHL' => 'Marshall Islands',
'MTQ' => 'Martinique',
'MRT' => 'Mauritania',
'MUS' => 'Mauritius',
'MYT' => 'Mayotte',
'MEX' => 'Mexico',
'FSM' => 'Micronesia, Federated States of',
'MDA' => 'Moldova, Republic of',
'MCO' => 'Monaco',
'MNG' => 'Mongolia',
'MNE' => 'Montenegro',
'MSR' => 'Montserrat',
'MAR' => 'Morocco',
'MOZ' => 'Mozambique',
'MMR' => 'Myanmar',
'NAM' => 'Namibia',
'NRU' => 'Nauru',
'NPL' => 'Nepal',
'NLD' => 'Netherlands',
'NCL' => 'New Caledonia',
'NZL' => 'New Zealand',
'NIC' => 'Nicaragua',
'NER' => 'Niger',
'NGA' => 'Nigeria',
'NIU' => 'Niue',
'NFK' => 'Norfolk Island',
'MNP' => 'Northern Mariana Islands',
'NOR' => 'Norway',
'OMN' => 'Oman',
'PAK' => 'Pakistan',
'PLW' => 'Palau',
'PSE' => 'Palestinian Territory, Occupied',
'PAN' => 'Panama',
'PNG' => 'Papua New Guinea',
'PRY' => 'Paraguay',
'PER' => 'Peru',
'PHL' => 'Philippines',
'PCN' => 'Pitcairn',
'POL' => 'Poland',
'PRT' => 'Portugal',
'PRI' => 'Puerto Rico',
'QAT' => 'Qatar',
'REU' => 'Réunion',
'ROU' => 'Romania',
'RUS' => 'Russian Federation',
'RWA' => 'Rwanda',
'BLM' => 'Saint Barthélemy',
'SHN' => 'Saint Helena, Ascension and Tristan da Cunha',
'KNA' => 'Saint Kitts and Nevis',
'LCA' => 'Saint Lucia',
'MAF' => 'Saint Martin (French part)',
'SPM' => 'Saint Pierre and Miquelon',
'VCT' => 'Saint Vincent and the Grenadines',
'WSM' => 'Samoa',
'SMR' => 'San Marino',
'STP' => 'Sao Tome and Principe',
'SAU' => 'Saudi Arabia',
'SEN' => 'Senegal',
'SRB' => 'Serbia',
'SYC' => 'Seychelles',
'SLE' => 'Sierra Leone',
'SGP' => 'Singapore',
'SXM' => 'Sint Maarten (Dutch part)',
'SVK' => 'Slovakia',
'SVN' => 'Slovenia',
'SLB' => 'Solomon Islands',
'SOM' => 'Somalia',
'ZAF' => 'South Africa',
'SGS' => 'South Georgia and the South Sandwich Islands',
'SSD' => 'South Sudan',
'ESP' => 'Spain',
'LKA' => 'Sri Lanka',
'SDN' => 'Sudan',
'SUR' => 'Suriname',
'SJM' => 'Svalbard and Jan Mayen',
'SWZ' => 'Swaziland',
'SWE' => 'Sweden',
'CHE' => 'Switzerland',
'SYR' => 'Syrian Arab Republic',
'TWN' => 'Taiwan, Province of China',
'TJK' => 'Tajikistan',
'TZA' => 'Tanzania, United Republic of',
'THA' => 'Thailand',
'TLS' => 'Timor-Leste',
'TGO' => 'Togo',
'TKL' => 'Tokelau',
'TON' => 'Tonga',
'TTO' => 'Trinidad and Tobago',
'TUN' => 'Tunisia',
'TUR' => 'Turkey',
'TKM' => 'Turkmenistan',
'TCA' => 'Turks and Caicos Islands',
'TUV' => 'Tuvalu',
'UGA' => 'Uganda',
'UKR' => 'Ukraine',
'ARE' => 'United Arab Emirates',
'GBR' => 'United Kingdom',
'USA' => 'United States',
'UMI' => 'United States Minor Outlying Islands',
'URY' => 'Uruguay',
'UZB' => 'Uzbekistan',
'VUT' => 'Vanuatu',
'VEN' => 'Venezuela, Bolivarian Republic of',
'VNM' => 'Viet Nam',
'VGB' => 'Virgin Islands, British',
'VIR' => 'Virgin Islands, U.S.',
'WLF' => 'Wallis and Futuna',
'ESH' => 'Western Sahara',
'YEM' => 'Yemen',
'ZMB' => 'Zambia',
'ZWE' => 'Zimbabwe',
];
return $this->select($name, $list, $selected, $options);
}
/**
* @param $name
* @param null $selected
* @param array $options
*
* @return string
*/
public function selectCountryNumeric($name, $selected = null, $options = [])
{
$list = [
'' => 'Select One...',
'4' => 'Afghanistan',
'248' => 'Åland Islands',
'8' => 'Albania',
'12' => 'Algeria',
'16' => 'American Samoa',
'20' => 'Andorra',
'24' => 'Angola',
'660' => 'Anguilla',
'10' => 'Antarctica',
'28' => 'Antigua and Barbuda',
'32' => 'Argentina',
'51' => 'Armenia',
'533' => 'Aruba',
'36' => 'Australia',
'40' => 'Austria',
'31' => 'Azerbaijan',
'44' => 'Bahamas',
'48' => 'Bahrain',
'50' => 'Bangladesh',
'52' => 'Barbados',
'112' => 'Belarus',
'56' => 'Belgium',
'84' => 'Belize',
'204' => 'Benin',
'60' => 'Bermuda',
'64' => 'Bhutan',
'68' => 'Bolivia, Plurinational State of',
'535' => 'Bonaire, Sint Eustatius and Saba',
'70' => 'Bosnia and Herzegovina',
'72' => 'Botswana',
'74' => 'Bouvet Island',
'76' => 'Brazil',
'86' => 'British Indian Ocean Territory',
'96' => 'Brunei Darussalam',
'100' => 'Bulgaria',
'854' => 'Burkina Faso',
'108' => 'Burundi',
'116' => 'Cambodia',
'120' => 'Cameroon',
'124' => 'Canada',
'132' => 'Cape Verde',
'136' => 'Cayman Islands',
'140' => 'Central African Republic',
'148' => 'Chad',
'152' => 'Chile',
'156' => 'China',
'162' => 'Christmas Island',
'166' => 'Cocos (Keeling) Islands',
'170' => 'Colombia',
'174' => 'Comoros',
'178' => 'Congo',
'180' => 'Congo, the Democratic Republic of the',
'184' => 'Cook Islands',
'188' => 'Costa Rica',
'384' => 'Côte d\'Ivoire',
'191' => 'Croatia',
'192' => 'Cuba',
'531' => 'Curaçao',
'196' => 'Cyprus',
'203' => 'Czech Republic',
'208' => 'Denmark',
'262' => 'Djibouti',
'212' => 'Dominica',
'214' => 'Dominican Republic',
'218' => 'Ecuador',
'818' => 'Egypt',
'222' => 'El Salvador',
'226' => 'Equatorial Guinea',
'232' => 'Eritrea',
'233' => 'Estonia',
'231' => 'Ethiopia',
'238' => 'Falkland Islands (Malvinas)',
'234' => 'Faroe Islands',
'242' => 'Fiji',
'246' => 'Finland',
'250' => 'France',
'254' => 'French Guiana',
'258' => 'French Polynesia',
'260' => 'French Southern Territories',
'266' => 'Gabon',
'270' => 'Gambia',
'268' => 'Georgia',
'276' => 'Germany',
'288' => 'Ghana',
'292' => 'Gibraltar',
'300' => 'Greece',
'304' => 'Greenland',
'308' => 'Grenada',
'312' => 'Guadeloupe',
'316' => 'Guam',
'320' => 'Guatemala',
'831' => 'Guernsey',
'324' => 'Guinea',
'624' => 'Guinea-Bissau',
'328' => 'Guyana',
'332' => 'Haiti',
'334' => 'Heard Island and McDonald Islands',
'336' => 'Holy See (Vatican City State)',
'340' => 'Honduras',
'344' => 'Hong Kong',
'348' => 'Hungary',
'352' => 'Iceland',
'356' => 'India',
'360' => 'Indonesia',
'364' => 'Iran, Islamic Republic of',
'368' => 'Iraq',
'372' => 'Ireland',
'833' => 'Isle of Man',
'376' => 'Israel',
'380' => 'Italy',
'388' => 'Jamaica',
'392' => 'Japan',
'832' => 'Jersey',
'400' => 'Jordan',
'398' => 'Kazakhstan',
'404' => 'Kenya',
'296' => 'Kiribati',
'408' => 'Korea, Democratic People\'s Republic of',
'410' => 'Korea, Republic of',
'414' => 'Kuwait',
'417' => 'Kyrgyzstan',
'418' => 'Lao People\'s Democratic Republic',
'428' => 'Latvia',
'422' => 'Lebanon',
'426' => 'Lesotho',
'430' => 'Liberia',
'434' => 'Libya',
'438' => 'Liechtenstein',
'440' => 'Lithuania',
'442' => 'Luxembourg',
'446' => 'Macao',
'807' => 'Macedonia, the former Yugoslav Republic of',
'450' => 'Madagascar',
'454' => 'Malawi',
'458' => 'Malaysia',
'462' => 'Maldives',
'466' => 'Mali',
'470' => 'Malta',
'584' => 'Marshall Islands',
'474' => 'Martinique',
'478' => 'Mauritania',
'480' => 'Mauritius',
'175' => 'Mayotte',
'484' => 'Mexico',
'583' => 'Micronesia, Federated States of',
'498' => 'Moldova, Republic of',
'492' => 'Monaco',
'496' => 'Mongolia',
'499' => 'Montenegro',
'500' => 'Montserrat',
'504' => 'Morocco',
'508' => 'Mozambique',
'104' => 'Myanmar',
'516' => 'Namibia',
'520' => 'Nauru',
'524' => 'Nepal',
'528' => 'Netherlands',
'540' => 'New Caledonia',
'554' => 'New Zealand',
'558' => 'Nicaragua',
'562' => 'Niger',
'566' => 'Nigeria',
'570' => 'Niue',
'574' => 'Norfolk Island',
'580' => 'Northern Mariana Islands',
'578' => 'Norway',
'512' => 'Oman',
'586' => 'Pakistan',
'585' => 'Palau',
'275' => 'Palestinian Territory, Occupied',
'591' => 'Panama',
'598' => 'Papua New Guinea',
'600' => 'Paraguay',
'604' => 'Peru',
'608' => 'Philippines',
'612' => 'Pitcairn',
'616' => 'Poland',
'620' => 'Portugal',
'630' => 'Puerto Rico',
'634' => 'Qatar',
'638' => 'Réunion',
'642' => 'Romania',
'643' => 'Russian Federation',
'646' => 'Rwanda',
'652' => 'Saint Barthélemy',
'654' => 'Saint Helena, Ascension and Tristan da Cunha',
'659' => 'Saint Kitts and Nevis',
'662' => 'Saint Lucia',
'663' => 'Saint Martin (French part)',
'666' => 'Saint Pierre and Miquelon',
'670' => 'Saint Vincent and the Grenadines',
'882' => 'Samoa',
'674' => 'San Marino',
'678' => 'Sao Tome and Principe',
'682' => 'Saudi Arabia',
'686' => 'Senegal',
'688' => 'Serbia',
'690' => 'Seychelles',
'694' => 'Sierra Leone',
'702' => 'Singapore',
'534' => 'Sint Maarten (Dutch part)',
'703' => 'Slovakia',
'705' => 'Slovenia',
'90' => 'Solomon Islands',
'706' => 'Somalia',
'710' => 'South Africa',
'239' => 'South Georgia and the South Sandwich Islands',
'728' => 'South Sudan',
'724' => 'Spain',
'144' => 'Sri Lanka',
'729' => 'Sudan',
'740' => 'Suriname',
'744' => 'Svalbard and Jan Mayen',
'748' => 'Swaziland',
'752' => 'Sweden',
'756' => 'Switzerland',
'760' => 'Syrian Arab Republic',
'158' => 'Taiwan, Province of China',
'762' => 'Tajikistan',
'834' => 'Tanzania, United Republic of',
'764' => 'Thailand',
'626' => 'Timor-Leste',
'768' => 'Togo',
'772' => 'Tokelau',
'776' => 'Tonga',
'780' => 'Trinidad and Tobago',
'788' => 'Tunisia',
'792' => 'Turkey',
'795' => 'Turkmenistan',
'796' => 'Turks and Caicos Islands',
'798' => 'Tuvalu',
'800' => 'Uganda',
'804' => 'Ukraine',
'784' => 'United Arab Emirates',
'826' => 'United Kingdom',
'840' => 'United States',
'581' => 'United States Minor Outlying Islands',
'858' => 'Uruguay',
'860' => 'Uzbekistan',
'548' => 'Vanuatu',
'862' => 'Venezuela, Bolivarian Republic of',
'704' => 'Viet Nam',
'92' => 'Virgin Islands, British',
'850' => 'Virgin Islands, U.S.',
'876' => 'Wallis and Futuna',
'732' => 'Western Sahara',
'887' => 'Yemen',
'894' => 'Zambia',
'716' => 'Zimbabwe',
];
return $this->select($name, $list, $selected, $options);
}
/**
* @param $name
* @param null $selected
* @param array $options
*
* @return mixed
*/
public function selectTimezone($name, $selected = null, $options = [])
{
$list = [];
$utc = new \DateTimeZone('UTC');
$dt = new \DateTime('now', $utc);
foreach (\DateTimeZone::listIdentifiers() as $tz) {
$current_tz = new \DateTimeZone($tz);
$offset = $current_tz->getOffset($dt);
$transition = $current_tz->getTransitions($dt->getTimestamp(), $dt->getTimestamp());
$abbr = $transition[0]['abbr'];
$list[$tz] = $tz.' ['.$abbr.' '.$this->formatOffset($offset).']';
}
return $this->select($name, $list, $selected, $options);
}
/**
* @param $offset
*
* @return string
*/
private function formatOffset($offset)
{
$hours = $offset / 3600;
$remainder = $offset % 3600;
$sign = $hours > 0 ? '+' : '-';
$hour = (int) abs($hours);
$minutes = (int) abs($remainder / 60);
if ($hour == 0 && $minutes == 0) {
$sign = ' ';
}
return $sign.str_pad($hour, 2, '0', STR_PAD_LEFT).':'.str_pad($minutes, 2, '0');
}
}
<?php
/**
* Represents a universally unique identifier (UUID), according to RFC 4122.
*
* This class provides the static methods `uuid3()`, `uuid4()`, and
* `uuid5()` for generating version 3, 4, and 5 UUIDs as specified in RFC 4122.
*
* If all you want is a unique ID, you should call `uuid4()`.
*
* @link http://tools.ietf.org/html/rfc4122
* @link http://en.wikipedia.org/wiki/Universally_unique_identifier
* @link http://www.php.net/manual/en/function.uniqid.php#94959
*/
namespace App\Helpers;
class uuid
{
/**
* When this namespace is specified, the name string is a fully-qualified domain name.
*
* @link http://tools.ietf.org/html/rfc4122#appendix-C
*/
const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
/**
* When this namespace is specified, the name string is a URL.
*
* @link http://tools.ietf.org/html/rfc4122#appendix-C
*/
const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
/**
* When this namespace is specified, the name string is an ISO OID.
*
* @link http://tools.ietf.org/html/rfc4122#appendix-C
*/
const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8';
/**
* When this namespace is specified, the name string is an X.500 DN in DER or a text output format.
*
* @link http://tools.ietf.org/html/rfc4122#appendix-C
*/
const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8';
/**
* The nil UUID is special form of UUID that is specified to have all 128 bits set to zero.
*
* @link http://tools.ietf.org/html/rfc4122#section-4.1.7
*/
const NIL = '00000000-0000-0000-0000-000000000000';
private static function getBytes($uuid)
{
if (!self::isValid($uuid)) {
throw new InvalidArgumentException('Invalid UUID string: '.$uuid);
}
// Get hexadecimal components of UUID
$uhex = str_replace([
'urn:',
'uuid:',
'-',
'{',
'}',
], '', $uuid);
// Binary Value
$ustr = '';
// Convert UUID to bits
for ($i = 0; $i < strlen($uhex); $i += 2) {
$ustr .= chr(hexdec($uhex[$i].$uhex[$i + 1]));
}
return $ustr;
}
private static function uuidFromHash($hash, $version)
{
return sprintf('%08s-%04s-%04x-%04x-%12s',
// 32 bits for "time_low"
substr($hash, 0, 8),
// 16 bits for "time_mid"
substr($hash, 8, 4),
// 16 bits for "time_hi_and_version",
// four most significant bits holds version number
(hexdec(substr($hash, 12, 4)) & 0x0fff) | $version << 12,
// 16 bits, 8 bits for "clk_seq_hi_res",
// 8 bits for "clk_seq_low",
// two most significant bits holds zero and one for variant DCE1.1
(hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,
// 48 bits for "node"
substr($hash, 20, 12));
}
/**
* Generate a version 3 UUID based on the MD5 hash of a namespace identifier
* (which is a UUID) and a name (which is a string).
*
* @param string $namespace The UUID namespace in which to create the named UUID
* @param string $name The name to create a UUID for
*
* @return string
*/
public static function uuid3($namespace, $name)
{
$nbytes = self::getBytes($namespace);
// Calculate hash value
$hash = md5($nbytes.$name);
return self::uuidFromHash($hash, 3);
}
/**
* Generate a version 4 (random) UUID.
*
* @return string
*/
public static function uuid4()
{
$bytes = function_exists('random_bytes') ? random_bytes(16) : openssl_random_pseudo_bytes(16);
$hash = bin2hex($bytes);
return self::uuidFromHash($hash, 4);
}
/**
* Generate a version 5 UUID based on the SHA-1 hash of a namespace
* identifier (which is a UUID) and a name (which is a string).
*
* @param string $namespace The UUID namespace in which to create the named UUID
* @param string $name The name to create a UUID for
*
* @return string
*/
public static function uuid5($namespace, $name)
{
$nbytes = self::getBytes($namespace);
// Calculate hash value
$hash = sha1($nbytes.$name);
return self::uuidFromHash($hash, 5);
}
/**
* Check if a string is a valid UUID.
*
* @param string $uuid The string UUID to test
*
* @return bool
*/
public static function isValid($uuid)
{
return preg_match('/^(urn:)?(uuid:)?(\{)?[0-9a-f]{8}\-?[0-9a-f]{4}\-?[0-9a-f]{4}\-?[0-9a-f]{4}\-?[0-9a-f]{12}(?(3)\}|)$/i', $uuid) === 1;
}
/**
* Check if two UUIDs are equal.
*
* @param string $uuid1 The first UUID to test
* @param string $uuid2 The second UUID to test
*
* @return bool
*/
public static function equals($uuid1, $uuid2)
{
return self::getBytes($uuid1) === self::getBytes($uuid2);
}
}
......@@ -9,6 +9,10 @@ use App\Http\Requests\Backend\Access\Permission\EditPermissionRequest;
use App\Http\Requests\Backend\Access\Permission\ManagePermissionRequest;
use App\Http\Requests\Backend\Access\Permission\StorePermissionRequest;
use App\Http\Requests\Backend\Access\Permission\UpdatePermissionRequest;
use App\Http\Responses\Backend\Access\Permission\CreateResponse;
use App\Http\Responses\Backend\Access\Permission\EditResponse;
use App\Http\Responses\RedirectResponse;
use App\Http\Responses\ViewResponse;
use App\Models\Access\Permission\Permission;
use App\Repositories\Backend\Access\Permission\PermissionRepository;
......@@ -33,71 +37,69 @@ class PermissionController extends Controller
/**
* @param ManagePermissionRequest $request
*
* @return mixed
* @return \App\Http\Responses\ViewResponse
*/
public function index(ManagePermissionRequest $request)
{
return view('backend.access.permissions.index');
return new ViewResponse('backend.access.permissions.index');
}
/**
* @param CreatePermissionRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Access\Permission\CreateResponse
*/
public function create(CreatePermissionRequest $request)
{
return view('backend.access.permissions.create')
->withPermissionCount($this->permissions->getCount());
return new CreateResponse($this->permissions);
}
/**
* @param StorePermissionRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function store(StorePermissionRequest $request)
{
$this->permissions->create($request->all());
return redirect()->route('admin.access.permission.index')->withFlashSuccess(trans('alerts.backend.permissions.created'));
return new RedirectResponse(route('admin.access.permission.index'), ['flash_success' => trans('alerts.backend.permissions.created')]);
}
/**
* @param Permission $permission
* @param EditPermissionRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Access\Permission\EditResponse
*/
public function edit(Permission $permission, EditPermissionRequest $request)
{
return view('backend.access.permissions.edit')
->withPermission($permission);
return new EditResponse($permission);
}
/**
* @param Permission $permission
* @param UpdatePermissionRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function update(Permission $permission, UpdatePermissionRequest $request)
{
$this->permissions->update($permission, $request->all());
return redirect()->route('admin.access.permission.index')->withFlashSuccess(trans('alerts.backend.permissions.updated'));
return new RedirectResponse(route('admin.access.permission.index'), ['flash_success' => trans('alerts.backend.permissions.updated')]);
}
/**
* @param Permission $permission
* @param DeletePermissionRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function destroy(Permission $permission, DeletePermissionRequest $request)
{
$this->permissions->delete($permission);
return redirect()->route('admin.access.permission.index')->withFlashSuccess(trans('alerts.backend.permissions.deleted'));
return new RedirectResponse(route('admin.access.permission.index'), ['flash_success' => trans('alerts.backend.permissions.deleted')]);
}
}
......@@ -9,6 +9,10 @@ use App\Http\Requests\Backend\Access\Role\EditRoleRequest;
use App\Http\Requests\Backend\Access\Role\ManageRoleRequest;
use App\Http\Requests\Backend\Access\Role\StoreRoleRequest;
use App\Http\Requests\Backend\Access\Role\UpdateRoleRequest;
use App\Http\Responses\Backend\Access\Role\CreateResponse;
use App\Http\Responses\Backend\Access\Role\EditResponse;
use App\Http\Responses\RedirectResponse;
use App\Http\Responses\ViewResponse;
use App\Models\Access\Role\Role;
use App\Repositories\Backend\Access\Permission\PermissionRepository;
use App\Repositories\Backend\Access\Role\RoleRepository;
......@@ -19,18 +23,18 @@ use App\Repositories\Backend\Access\Role\RoleRepository;
class RoleController extends Controller
{
/**
* @var RoleRepository
* @var \App\Repositories\Backend\Access\Role\RoleRepository
*/
protected $roles;
/**
* @var PermissionRepository
* @var \App\Repositories\Backend\Access\Permission\PermissionRepository
*/
protected $permissions;
/**
* @param RoleRepository $roles
* @param PermissionRepository $permissions
* @param \App\Repositories\Backend\Access\Role\RoleRepository $roles
* @param \App\Repositories\Backend\Access\Permission\PermissionRepository $permissions
*/
public function __construct(RoleRepository $roles, PermissionRepository $permissions)
{
......@@ -39,76 +43,71 @@ class RoleController extends Controller
}
/**
* @param ManageRoleRequest $request
* @param \App\Http\Requests\Backend\Access\Role\ManageRoleRequest $request
*
* @return mixed
*/
public function index(ManageRoleRequest $request)
{
return view('backend.access.roles.index');
return new ViewResponse('backend.access.roles.index');
}
/**
* @param CreateRoleRequest $request
* @param \App\Http\Requests\Backend\Access\Role\CreateRoleRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Access\Role\CreateResponse
*/
public function create(CreateRoleRequest $request)
{
return view('backend.access.roles.create')
->withPermissions($this->permissions->getAll())
->withRoleCount($this->roles->getCount());
return new CreateResponse($this->permissions, $this->roles);
}
/**
* @param StoreRoleRequest $request
* @param \App\Http\Requests\Backend\Access\Role\StoreRoleRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function store(StoreRoleRequest $request)
{
$this->roles->create($request->all());
return redirect()->route('admin.access.role.index')->withFlashSuccess(trans('alerts.backend.roles.created'));
return new RedirectResponse(route('admin.access.role.index'), ['flash_success' => trans('alerts.backend.roles.created')]);
}
/**
* @param Role $role
* @param EditRoleRequest $request
* @param \App\Models\Access\Role\Role $role
* @param \App\Http\Requests\Backend\Access\Role\EditRoleRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Access\Role\EditResponse
*/
public function edit(Role $role, EditRoleRequest $request)
{
return view('backend.access.roles.edit')
->withRole($role)
->withRolePermissions($role->permissions->pluck('id')->all())
->withPermissions($this->permissions->getAll());
return new EditResponse($role, $this->permissions);
}
/**
* @param Role $role
* @param UpdateRoleRequest $request
* @param \App\Models\Access\Role\Role $role
* @param \App\Http\Requests\Backend\Access\Role\UpdateRoleRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function update(Role $role, UpdateRoleRequest $request)
{
$this->roles->update($role, $request->all());
return redirect()->route('admin.access.role.index')->withFlashSuccess(trans('alerts.backend.roles.updated'));
return new RedirectResponse(route('admin.access.role.index'), ['flash_success' => trans('alerts.backend.roles.updated')]);
}
/**
* @param Role $role
* @param DeleteRoleRequest $request
* @param \App\Models\Access\Role\Role $role
* @param \App\Http\Requests\Backend\Access\Role\DeleteRoleRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function destroy(Role $role, DeleteRoleRequest $request)
{
$this->roles->delete($role);
return redirect()->route('admin.access.role.index')->withFlashSuccess(trans('alerts.backend.roles.deleted'));
return new RedirectResponse(route('admin.access.role.index'), ['flash_success' => trans('alerts.backend.roles.deleted')]);
}
}
......@@ -10,6 +10,11 @@ use App\Http\Requests\Backend\Access\User\ManageUserRequest;
use App\Http\Requests\Backend\Access\User\ShowUserRequest;
use App\Http\Requests\Backend\Access\User\StoreUserRequest;
use App\Http\Requests\Backend\Access\User\UpdateUserRequest;
use App\Http\Responses\Backend\Access\User\CreateResponse;
use App\Http\Responses\Backend\Access\User\EditResponse;
use App\Http\Responses\Backend\Access\User\ShowResponse;
use App\Http\Responses\RedirectResponse;
use App\Http\Responses\ViewResponse;
use App\Models\Access\Permission\Permission;
use App\Models\Access\User\User;
use App\Repositories\Backend\Access\Role\RoleRepository;
......@@ -21,18 +26,18 @@ use App\Repositories\Backend\Access\User\UserRepository;
class UserController extends Controller
{
/**
* @var UserRepository
* @var \App\Repositories\Backend\Access\User\UserRepository
*/
protected $users;
/**
* @var RoleRepository
* @var \App\Repositories\Backend\Access\Role\RoleRepository
*/
protected $roles;
/**
* @param UserRepository $users
* @param RoleRepository $roles
* @param \App\Repositories\Backend\Access\User\UserRepository $users
* @param \App\Repositories\Backend\Access\Role\RoleRepository $roles
*/
public function __construct(UserRepository $users, RoleRepository $roles)
{
......@@ -41,94 +46,87 @@ class UserController extends Controller
}
/**
* @param ManageUserRequest $request
* @param \App\Http\Requests\Backend\Access\User\ManageUserRequest $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @return \App\Http\Responses\ViewResponse
*/
public function index(ManageUserRequest $request)
{
return view('backend.access.users.index');
return new ViewResponse('backend.access.users.index');
}
/**
* @param CreateUserRequest $request
* @param \App\Http\Requests\Backend\Access\User\CreateUserRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Access\User\CreateResponse
*/
public function create(CreateUserRequest $request)
{
return view('backend.access.users.create')->with([
'roles' => $this->roles->getAll(),
]);
$roles = $this->roles->getAll();
return new CreateResponse($roles);
}
/**
* @param StoreUserRequest $request
* @param \App\Http\Requests\Backend\Access\User\StoreUserRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function store(StoreUserRequest $request)
{
$this->users->create($request);
return redirect()->route('admin.access.user.index')->withFlashSuccess(trans('alerts.backend.users.created'));
return new RedirectResponse(route('admin.access.user.index'), ['flash_success' => trans('alerts.backend.users.created')]);
}
/**
* @param User $user
* @param ShowUserRequest $request
* @param \App\Models\Access\User\User $user
* @param \App\Http\Requests\Backend\Access\User\ShowUserRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Access\User\ShowResponse
*/
public function show(User $user, ShowUserRequest $request)
{
return view('backend.access.users.show')
->withUser($user);
return new ShowResponse($user);
}
/**
* @param User $user
* @param EditUserRequest $request
* @param \App\Models\Access\User\User $user
* @param \App\Http\Requests\Backend\Access\User\EditUserRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Access\User\EditResponse
*/
public function edit(User $user, EditUserRequest $request)
{
$roles = $this->roles->getAll();
$permissions = Permission::getSelectData('display_name');
$userPermissions = $user->permissions()->get()->pluck('id')->toArray();
return view('backend.access.users.edit')->with([
'user' => $user,
'userRoles' => $user->roles->pluck('id')->all(),
'roles' => $this->roles->getAll(),
'userPermissions' => $userPermissions,
'permissions' => $permissions,
]);
return new EditResponse($user, $roles, $permissions);
}
/**
* @param User $user
* @param UpdateUserRequest $request
* @param \App\Models\Access\User\User $user
* @param \App\Http\Requests\Backend\Access\User\UpdateUserRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function update(User $user, UpdateUserRequest $request)
{
$this->users->update($user, $request);
return redirect()->route('admin.access.user.index')->withFlashSuccess(trans('alerts.backend.users.updated'));
return new RedirectResponse(route('admin.access.user.index'), ['flash_success' => trans('alerts.backend.users.updated')]);
}
/**
* @param User $user
* @param DeleteUserRequest $request
* @param \App\Models\Access\User\User $user
* @param \App\Http\Requests\Backend\Access\User\DeleteUserRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function destroy(User $user, DeleteUserRequest $request)
{
$this->users->delete($user);
return redirect()->route('admin.access.user.deleted')->withFlashSuccess(trans('alerts.backend.users.deleted'));
return new RedirectResponse(route('admin.access.user.index'), ['flash_success' => trans('alerts.backend.users.deleted')]);
}
}
......@@ -14,12 +14,12 @@ use Yajra\DataTables\Facades\DataTables;
class UserTableController extends Controller
{
/**
* @var UserRepository
* @var \App\Repositories\Backend\Access\User\UserRepository
*/
protected $users;
/**
* @param UserRepository $users
* @param \App\Repositories\Backend\Access\User\UserRepository $users
*/
public function __construct(UserRepository $users)
{
......@@ -27,7 +27,7 @@ class UserTableController extends Controller
}
/**
* @param ManageUserRequest $request
* @param \App\Http\Requests\Backend\Access\User\ManageUserRequest $request
*
* @return mixed
*/
......
......@@ -9,6 +9,8 @@ use App\Http\Requests\Backend\BlogCategories\EditBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\ManageBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\StoreBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\UpdateBlogCategoriesRequest;
use App\Http\Responses\RedirectResponse;
use App\Http\Responses\ViewResponse;
use App\Models\BlogCategories\BlogCategory;
use App\Repositories\Backend\BlogCategories\BlogCategoriesRepository;
......@@ -30,21 +32,21 @@ class BlogCategoriesController extends Controller
/**
* @param \App\Http\Requests\Backend\BlogCategories\ManageBlogCategoriesRequest $request
*
* @return mixed
* @return ViewResponse
*/
public function index(ManageBlogCategoriesRequest $request)
{
return view('backend.blogcategories.index');
return new ViewResponse('backend.blogcategories.index');
}
/**
* @param \App\Http\Requests\Backend\BlogCategories\CreateBlogCategoriesRequest $request
*
* @return mixed
* @return \App\Http\Responses\ViewResponse
*/
public function create(CreateBlogCategoriesRequest $request)
{
return view('backend.blogcategories.create');
return new ViewResponse('backend.blogcategories.create');
}
/**
......@@ -56,9 +58,7 @@ class BlogCategoriesController extends Controller
{
$this->blogcategory->create($request->all());
return redirect()
->route('admin.blogCategories.index')
->with('flash_success', trans('alerts.backend.blogcategories.created'));
return new RedirectResponse(route('admin.blogCategories.index'), ['flash_success' => trans('alerts.backend.blogcategories.created')]);
}
/**
......@@ -69,37 +69,32 @@ class BlogCategoriesController extends Controller
*/
public function edit(BlogCategory $blogCategory, EditBlogCategoriesRequest $request)
{
return view('backend.blogcategories.edit')
->with('blogcategory', $blogCategory);
return new EditResponse($blogCategory);
}
/**
* @param \App\Models\BlogCategories\BlogCategory $blogCategory
* @param \App\Http\Requests\Backend\BlogCategories\UpdateBlogCategoriesRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function update(BlogCategory $blogCategory, UpdateBlogCategoriesRequest $request)
{
$this->blogcategory->update($blogCategory, $request->all());
return redirect()
->route('admin.blogCategories.index')
->with('flash_success', trans('alerts.backend.blogcategories.updated'));
return new RedirectResponse(route('admin.blogCategories.index'), ['flash_success' => trans('alerts.backend.blogcategories.updated')]);
}
/**
* @param \App\Models\BlogCategories\BlogCategory $blogCategory
* @param \App\Http\Requests\Backend\BlogCategories\DeleteBlogCategoriesRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function destroy(BlogCategory $blogCategory, DeleteBlogCategoriesRequest $request)
{
$this->blogcategory->delete($blogCategory);
return redirect()
->route('admin.blogCategories.index')
->with('flash_success', trans('alerts.backend.blogcategories.deleted'));
return new RedirectResponse(route('admin.blogCategories.index'), ['flash_success' => trans('alerts.backend.blogcategories.deleted')]);
}
}
......@@ -9,6 +9,9 @@ use App\Http\Requests\Backend\BlogTags\EditBlogTagsRequest;
use App\Http\Requests\Backend\BlogTags\ManageBlogTagsRequest;
use App\Http\Requests\Backend\BlogTags\StoreBlogTagsRequest;
use App\Http\Requests\Backend\BlogTags\UpdateBlogTagsRequest;
use App\Http\Responses\Backend\BlogTag\EditResponse;
use App\Http\Responses\RedirectResponse;
use App\Http\Responses\ViewResponse;
use App\Models\BlogTags\BlogTag;
use App\Repositories\Backend\BlogTags\BlogTagsRepository;
......@@ -33,47 +36,44 @@ class BlogTagsController extends Controller
/**
* @param \App\Http\Requests\Backend\BlogTags\ManageBlogTagsRequest $request
*
* @return mixed
* @return \App\Http\Responses\ViewResponse
*/
public function index(ManageBlogTagsRequest $request)
{
return view('backend.blogtags.index');
return new ViewResponse('backend.blogtags.index');
}
/**
* @param \App\Http\Requests\Backend\BlogTags\CreateBlogTagsRequest $request
*
* @return mixed
* @return \App\Http\Responses\ViewResponse
*/
public function create(CreateBlogTagsRequest $request)
{
return view('backend.blogtags.create');
return new ViewResponse('backend.blogtags.create');
}
/**
* @param \App\Http\Requests\Backend\BlogTags\StoreBlogTagsRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function store(StoreBlogTagsRequest $request)
{
$this->blogtag->create($request->except('token'));
return redirect()
->route('admin.blogTags.index')
->with('flash_success', trans('alerts.backend.blogtags.created'));
return new RedirectResponse(route('admin.blogTags.index'), ['flash_success' => trans('alerts.backend.blogtags.created')]);
}
/**
* @param \App\Models\BlogTags\BlogTag $blogTag
* @param \App\Http\Requests\Backend\BlogTags\EditBlogTagsRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\BlogTag\EditResponse
*/
public function edit(BlogTag $blogTag, EditBlogTagsRequest $request)
{
return view('backend.blogtags.edit')
->with('blogtag', $blogTag);
return new EditResponse($blogTag);
}
/**
......@@ -86,9 +86,7 @@ class BlogTagsController extends Controller
{
$this->blogtag->update($blogTag, $request->except(['_method', '_token']));
return redirect()
->route('admin.blogTags.index')
->with('flash_success', trans('alerts.backend.blogtags.updated'));
return new RedirectResponse(route('admin.blogTags.index'), ['flash_success' => trans('alerts.backend.blogtags.updated')]);
}
/**
......@@ -101,8 +99,6 @@ class BlogTagsController extends Controller
{
$this->blogtag->delete($blogTag);
return redirect()
->route('admin.blogTags.index')
->with('flash_success', trans('alerts.backend.blogtags.deleted'));
return new RedirectResponse(route('admin.blogTags.index'), ['flash_success' => trans('alerts.backend.blogtags.deleted')]);
}
}
......@@ -6,6 +6,10 @@ use App\Http\Controllers\Controller;
use App\Http\Requests\Backend\Blogs\ManageBlogsRequest;
use App\Http\Requests\Backend\Blogs\StoreBlogsRequest;
use App\Http\Requests\Backend\Blogs\UpdateBlogsRequest;
use App\Http\Responses\Backend\Blog\CreateResponse;
use App\Http\Responses\Backend\Blog\EditResponse;
use App\Http\Responses\Backend\Blog\IndexResponse;
use App\Http\Responses\RedirectResponse;
use App\Models\BlogCategories\BlogCategory;
use App\Models\Blogs\Blog;
use App\Models\BlogTags\BlogTag;
......@@ -42,13 +46,11 @@ class BlogsController extends Controller
/**
* @param \App\Http\Requests\Backend\Blogs\ManageBlogsRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Blog\IndexResponse
*/
public function index(ManageBlogsRequest $request)
{
return view('backend.blogs.index')->with([
'status'=> $this->status,
]);
return new IndexResponse($this->status);
}
/**
......@@ -61,56 +63,40 @@ class BlogsController extends Controller
$blogTags = BlogTag::getSelectData();
$blogCategories = BlogCategory::getSelectData();
return view('backend.blogs.create')->with([
'blogCategories' => $blogCategories,
'blogTags' => $blogTags,
'status' => $this->status,
]);
return new CreateResponse($this->status, $blogCategories, $blogTags);
}
/**
* @param \App\Http\Requests\Backend\Blogs\StoreBlogsRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function store(StoreBlogsRequest $request)
{
$this->blog->create($request->except('_token'));
return redirect()
->route('admin.blogs.index')
->with('flash_success', trans('alerts.backend.blogs.created'));
return new RedirectResponse(route('admin.blogs.index'), ['flash_success' => trans('alerts.backend.blogs.created')]);
}
/**
* @param \App\Models\Blogs\Blog $blog
* @param \App\Http\Requests\Backend\Blogs\ManageBlogsRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Blog\EditResponse
*/
public function edit(Blog $blog, ManageBlogsRequest $request)
{
$blogCategories = BlogCategory::getSelectData();
$blogTags = BlogTag::getSelectData();
$selectedCategories = $blog->categories->pluck('id')->toArray();
$selectedtags = $blog->tags->pluck('id')->toArray();
return view('backend.blogs.edit')->with([
'blog' => $blog,
'blogCategories' => $blogCategories,
'blogTags' => $blogTags,
'selectedCategories' => $selectedCategories,
'selectedtags' => $selectedtags,
'status' => $this->status,
]);
return new EditResponse($blog, $this->status, $blogCategories, $blogTags);
}
/**
* @param \App\Models\Blogs\Blog $blog
* @param \App\Http\Requests\Backend\Blogs\UpdateBlogsRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function update(Blog $blog, UpdateBlogsRequest $request)
{
......@@ -118,23 +104,19 @@ class BlogsController extends Controller
$this->blog->update($blog, $request->except(['_token', '_method']));
return redirect()
->route('admin.blogs.index')
->with('flash_success', trans('alerts.backend.blogs.updated'));
return new RedirectResponse(route('admin.blogs.index'), ['flash_success' => trans('alerts.backend.blogs.updated')]);
}
/**
* @param \App\Models\Blogs\Blog $blog
* @param \App\Http\Requests\Backend\Blogs\ManageBlogsRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function destroy(Blog $blog, ManageBlogsRequest $request)
{
$this->blog->delete($blog);
return redirect()
->route('admin.blogs.index')
->with('flash_success', trans('alerts.backend.blogs.deleted'));
return new RedirectResponse(route('admin.blogs.index'), ['flash_success' => trans('alerts.backend.blogs.deleted')]);
}
}
......@@ -9,11 +9,19 @@ use App\Http\Requests\Backend\Faqs\EditFaqsRequest;
use App\Http\Requests\Backend\Faqs\ManageFaqsRequest;
use App\Http\Requests\Backend\Faqs\StoreFaqsRequest;
use App\Http\Requests\Backend\Faqs\UpdateFaqsRequest;
use App\Http\Responses\Backend\Faq\EditResponse;
use App\Http\Responses\RedirectResponse;
use App\Http\Responses\ViewResponse;
use App\Models\Faqs\Faq;
use App\Repositories\Backend\Faqs\FaqsRepository;
class FaqsController extends Controller
{
/**
* Faq Repository.
*
* @var \App\Repositories\Backend\Faqs\FaqsRepository
*/
protected $faq;
/**
......@@ -29,11 +37,11 @@ class FaqsController extends Controller
*
* @param \App\Http\Requests\Backend\Faqs\ManageFaqsRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\ViewResponse
*/
public function index(ManageFaqsRequest $request)
{
return view('backend.faqs.index');
return new ViewResponse('backend.faqs.index');
}
/**
......@@ -41,11 +49,11 @@ class FaqsController extends Controller
*
* @param \App\Http\Requests\Backend\Faqs\CreateFaqsRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\ViewResponse
*/
public function create(CreateFaqsRequest $request)
{
return view('backend.faqs.create');
return new ViewResponse('backend.faqs.create');
}
/**
......@@ -53,17 +61,13 @@ class FaqsController extends Controller
*
* @param \App\Http\Requests\Backend\Faqs\StoreFaqsRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\RedirectResponse
*/
public function store(StoreFaqsRequest $request)
{
$input = $request->all();
$this->faq->create($request->all());
$this->faq->create($input);
return redirect()
->route('admin.faqs.index')
->with('flash_success', trans('alerts.backend.faqs.created'));
return new RedirectResponse(route('admin.faqs.index'), ['flash_success' => trans('alerts.backend.faqs.created')]);
}
/**
......@@ -72,12 +76,11 @@ class FaqsController extends Controller
* @param \App\Models\Faqs\Faq $faq
* @param \App\Http\Requests\Backend\Faqs\EditFaqsRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\Backend\Faq\EditResponse
*/
public function edit(Faq $faq, EditFaqsRequest $request)
{
return view('backend.faqs.edit')
->with('faq', $faq);
return new EditResponse($faq);
}
/**
......@@ -86,17 +89,13 @@ class FaqsController extends Controller
* @param \App\Http\Requests\Backend\Faqs\UpdateFaqsRequest $request
* @param \App\Models\Faqs\Faq $id
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\RedirectResponse
*/
public function update(UpdateFaqsRequest $request, Faq $faq)
{
$input = $request->all();
$this->faq->update($faq, $input);
$this->faq->update($faq, $request->all());
return redirect()
->route('admin.faqs.index')
->with('flash_success', trans('alerts.backend.faqs.updated'));
return new RedirectResponse(route('admin.faqs.index'), ['flash_success' => trans('alerts.backend.faqs.updated')]);
}
/**
......@@ -105,14 +104,12 @@ class FaqsController extends Controller
* @param \App\Models\Faqs\Faq $faq
* @param \App\Http\Requests\Backend\Faqs\DeleteFaqsRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\RedirectResponse
*/
public function destroy(Faq $faq, DeleteFaqsRequest $request)
{
$this->faq->delete($faq);
return redirect()
->route('admin.faqs.index')
->with('flash_success', trans('alerts.backend.faqs.deleted'));
return new RedirectResponse(route('admin.faqs.index'), ['flash_success' => trans('alerts.backend.faqs.deleted')]);
}
}
......@@ -9,20 +9,50 @@ use App\Http\Requests\Backend\Menu\EditMenuRequest;
use App\Http\Requests\Backend\Menu\ManageMenuRequest;
use App\Http\Requests\Backend\Menu\StoreMenuRequest;
use App\Http\Requests\Backend\Menu\UpdateMenuRequest;
use App\Http\Responses\Backend\Menu\CreateResponse;
use App\Http\Responses\Backend\Menu\EditResponse;
use App\Http\Responses\RedirectResponse;
use App\Http\Responses\ViewResponse;
use App\Models\Menu\Menu;
use App\Repositories\Backend\Menu\MenuRepository;
use Illuminate\Support\Facades\DB;
use Bvipul\Generator\Module;
class MenuController extends Controller
{
/**
* Menu Model Object.
*
* @var \App\Models\Menu\Menu
*/
protected $menu;
/**
* Module Model Object.
*
* @var \Bvipul\Generator\Module
*/
protected $modules;
/**
* Menu Types.
*
* @var array
*/
protected $types;
/**
* @param \App\Repositories\Backend\Menu\MenuRepository $menu
*/
public function __construct(MenuRepository $menu)
public function __construct(MenuRepository $menu, Module $module)
{
$this->menu = $menu;
$this->modules = $module;
$this->types = [
'backend' => 'Backend',
'frontend' => 'Frontend',
];
}
/**
......@@ -30,11 +60,11 @@ class MenuController extends Controller
*
* @param \App\Http\Requests\Backend\Menu\ManageMenuRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\ViewResponse
*/
public function index(ManageMenuRequest $request)
{
return view('backend.menus.index');
return new ViewResponse('backend.menus.index');
}
/**
......@@ -42,17 +72,11 @@ class MenuController extends Controller
*
* @param \App\Http\Requests\Backend\Menu\CreateMenuRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\Backend\Menu\CreateResponse
*/
public function create(CreateMenuRequest $request)
{
$types = [
'backend' => 'Backend',
'frontend' => 'Frontend',
];
$modules = DB::table('modules')->get();
return view('backend.menus.create')->withTypes($types)->withModules($modules);
return new CreateResponse($this->types, $this->modules);
}
/**
......@@ -60,13 +84,13 @@ class MenuController extends Controller
*
* @param \App\Http\Requests\Backend\Menu\StoreMenuRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\RedirectResponse
*/
public function store(StoreMenuRequest $request)
{
$this->menu->create($request->except('_token'));
return redirect()->route('admin.menus.index')->withFlashSuccess(trans('alerts.backend.menus.created'));
return new RedirectResponse(route('admin.menus.index'), ['flash_success' => trans('alerts.backend.menus.created')]);
}
/**
......@@ -75,21 +99,11 @@ class MenuController extends Controller
* @param \App\Models\Menu\Menu $menu
* @param \App\Http\Requests\Backend\Menu\EditMenuRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\Backend\Menu\EditResponse
*/
public function edit(Menu $menu, EditMenuRequest $request)
{
$types = [
'backend' => 'Backend',
'frontend' => 'Frontend',
];
$modules = DB::table('modules')->get();
return view('backend.menus.edit')
->with('types', $types)
->with('menu', $menu)
->with('modules', $modules);
return new EditResponse($menu, $this->types, $this->modules);
}
/**
......@@ -98,15 +112,13 @@ class MenuController extends Controller
* @param \App\Models\Menu\Menu $menu
* @param \App\Http\Requests\Backend\Menu\UpdateMenuRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\RedirectResponse
*/
public function update(Menu $menu, UpdateMenuRequest $request)
{
$this->menu->update($menu, $request->all());
return redirect()
->route('admin.menus.index')
->with('flash_success', trans('alerts.backend.menus.updated'));
return new RedirectResponse(route('admin.menus.index'), ['flash_success' => trans('alerts.backend.menus.updated')]);
}
/**
......@@ -115,14 +127,12 @@ class MenuController extends Controller
* @param \App\Models\Menu\Menu $menu
* @param \App\Http\Requests\Backend\Menu\DeleteMenuRequest $request
*
* @return \Illuminate\Http\Response
* @return \App\Http\Responses\RedirectResponse
*/
public function destroy(Menu $menu, DeleteMenuRequest $request)
{
$this->menu->delete($menu);
return redirect()
->route('admin.menus.index')
->with('flash_success', trans('alerts.backend.menus.deleted'));
return new RedirectResponse(route('admin.menus.index'), ['flash_success' => trans('alerts.backend.menus.deleted')]);
}
}
......@@ -9,6 +9,9 @@ use App\Http\Requests\Backend\Pages\EditPageRequest;
use App\Http\Requests\Backend\Pages\ManagePageRequest;
use App\Http\Requests\Backend\Pages\StorePageRequest;
use App\Http\Requests\Backend\Pages\UpdatePageRequest;
use App\Http\Responses\Backend\Page\EditResponse;
use App\Http\Responses\RedirectResponse;
use App\Http\Responses\ViewResponse;
use App\Models\Page\Page;
use App\Repositories\Backend\Pages\PagesRepository;
......@@ -30,70 +33,69 @@ class PagesController extends Controller
/**
* @param \App\Http\Requests\Backend\Pages\ManagePageRequest $request
*
* @return mixed
* @return \App\Http\Responses\ViewResponse
*/
public function index(ManagePageRequest $request)
{
return view('backend.pages.index');
return new ViewResponse('backend.pages.index');
}
/**
* @param \App\Http\Requests\Backend\Pages\CreatePageRequest $request
*
* @return mixed
* @return \App\Http\Responses\ViewResponse
*/
public function create(CreatePageRequest $request)
{
return view('backend.pages.create');
return new ViewResponse('backend.pages.create');
}
/**
* @param \App\Http\Requests\Backend\Pages\StorePageRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function store(StorePageRequest $request)
{
$this->pages->create($request->except(['_token']));
return redirect()->route('admin.pages.index')->withFlashSuccess(trans('alerts.backend.pages.created'));
return new RedirectResponse(route('admin.pages.index'), ['flash_success' => trans('alerts.backend.pages.created')]);
}
/**
* @param \App\Models\Page\Page $page
* @param \App\Http\Requests\Backend\Pages\EditPageRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Page\EditResponse
*/
public function edit(Page $page, EditPageRequest $request)
{
return view('backend.pages.edit')
->withPage($page);
return new EditResponse($page);
}
/**
* @param \App\Models\Page\Page $page
* @param \App\Http\Requests\Backend\Pages\UpdatePageRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function update(Page $page, UpdatePageRequest $request)
{
$this->pages->update($page, $request->except(['_method', '_token']));
return redirect()->route('admin.pages.index')->withFlashSuccess(trans('alerts.backend.pages.updated'));
return new RedirectResponse(route('admin.pages.index'), ['flash_success' => trans('alerts.backend.pages.updated')]);
}
/**
* @param \App\Models\Page\Page $page
* @param \App\Http\Requests\Backend\Pages\DeletePageRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function destroy(Page $page, DeletePageRequest $request)
{
$this->pages->delete($page);
return redirect()->route('admin.pages.index')->withFlashSuccess(trans('alerts.backend.pages.deleted'));
return new RedirectResponse(route('admin.pages.index'), ['flash_success' => trans('alerts.backend.pages.deleted')]);
}
}
......@@ -5,6 +5,8 @@ namespace App\Http\Controllers\Backend\Settings;
use App\Http\Controllers\Controller;
use App\Http\Requests\Backend\Settings\ManageSettingsRequest;
use App\Http\Requests\Backend\Settings\UpdateSettingsRequest;
use App\Http\Responses\Backend\Setting\EditResponse;
use App\Http\Responses\RedirectResponse;
use App\Models\Settings\Setting;
use App\Repositories\Backend\Settings\SettingsRepository;
......@@ -27,26 +29,23 @@ class SettingsController extends Controller
* @param \App\Models\Settings\Setting $setting
* @param \App\Http\Requests\Backend\Settings\ManageSettingsRequest $request
*
* @return mixed
* @return \App\Http\Responses\Backend\Setting\EditResponse
*/
public function edit(Setting $setting, ManageSettingsRequest $request)
{
return view('backend.settings.edit')
->withSetting($setting);
return new EditResponse($setting);
}
/**
* @param \App\Models\Settings\Setting $setting
* @param \App\Http\Requests\Backend\Settings\UpdateSettingsRequest $request
*
* @return mixed
* @return \App\Http\Responses\RedirectResponse
*/
public function update(Setting $setting, UpdateSettingsRequest $request)
{
$this->settings->update($setting, $request->except(['_token', '_method']));
return redirect()
->route('admin.settings.edit', $setting->id)
->with('flash_success', trans('alerts.backend.settings.updated'));
return new RedirectResponse(route('admin.settings.edit', $setting->id), ['flash_success' => trans('alerts.backend.settings.updated')]);
}
}
......@@ -3,6 +3,7 @@
namespace App\Http\Middleware;
use Closure;
use Cookie;
use Illuminate\Session\Store;
/**
......@@ -39,7 +40,10 @@ class SessionTimeout
*/
public function handle($request, Closure $next)
{
if (config('session.timeout_status')) {
//Cookie Name for when 'remember me' is checked
$remember_cookie = \Auth::guard()->getRecallerName();
if (!Cookie::has($remember_cookie) && config('session.timeout_status')) {
$isLoggedIn = $request->path() != '/logout';
if (!session('lastActivityTime')) {
......
<?php
namespace App\Http\Responses\Backend\Access\Permission;
use Illuminate\Contracts\Support\Responsable;
class CreateResponse implements Responsable
{
/**
* @var \App\Repositories\Backend\Access\Permission\PermissionRepository
*/
protected $permissions;
/**
* @param \App\Repositories\Backend\Access\Permission\PermissionRepository $permissions
*/
public function __construct($permissions)
{
$this->permissions = $permissions;
}
/**
* In Response.
*
* @param \App\Http\Requests\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.access.permissions.create')
->withPermissionCount($this->permissions->getCount());
}
}
<?php
namespace App\Http\Responses\Backend\Access\Permission;
use Illuminate\Contracts\Support\Responsable;
class EditResponse implements Responsable
{
/**
* @var \App\Models\Access\Permission\Permission
*/
protected $permission;
/**
* @param \App\Models\Access\Permission\Permission $permission
*/
public function __construct($permission)
{
$this->permission = $permission;
}
/**
* toReponse.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.access.permissions.edit')
->withPermission($this->permission);
}
}
<?php
namespace App\Http\Responses\Backend\Access\Role;
use Illuminate\Contracts\Support\Responsable;
class CreateResponse implements Responsable
{
/**
* @var \App\Repositories\Backend\Access\Role\RoleRepository
*/
protected $roles;
/**
* @var \App\Repositories\Backend\Access\Permission\PermissionRepository
*/
protected $permissions;
/**
* @param \App\Repositories\Backend\Access\Permission\PermissionRepository $permissions
* @param \App\Repositories\Backend\Access\Role\RoleRepository $roles
*/
public function __construct($permissions, $roles)
{
$this->permissions = $permissions;
$this->roles = $roles;
}
/**
* In Response.
*
* @param \App\Http\Requests\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.access.roles.create')
->withPermissions($this->permissions->getAll())
->withRoleCount($this->roles->getCount());
}
}
<?php
namespace App\Http\Responses\Backend\Access\Role;
use Illuminate\Contracts\Support\Responsable;
class EditResponse implements Responsable
{
/**
* @var \App\Models\Access\Role\Role
*/
protected $role;
/**
* @var \App\Repositories\Backend\Access\Permission\PermissionRepository
*/
protected $permissions;
/**
* @param \App\Models\Access\Role\Role $role
* @param \App\Repositories\Backend\Access\Permission\PermissionRepository $permissions
*/
public function __construct($role, $permissions)
{
$this->role = $role;
$this->permissions = $permissions;
}
/**
* toReponse.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.access.roles.edit')
->withRole($this->role)
->withRolePermissions($this->role->permissions->pluck('id')->all())
->withPermissions($this->permissions->getAll());
}
}
<?php
namespace App\Http\Responses\Backend\Access\User;
use Illuminate\Contracts\Support\Responsable;
class CreateResponse implements Responsable
{
/**
* @var \App\Models\Access\Role\Role
*/
protected $roles;
/**
* @param \Illuminate\Database\Eloquent\Collection $roles
*/
public function __construct($roles)
{
$this->roles = $roles;
}
/**
* In Response.
*
* @param \App\Http\Requests\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.access.users.create')->with([
'roles' => $this->roles,
]);
}
}
<?php
namespace App\Http\Responses\Backend\Access\User;
use Illuminate\Contracts\Support\Responsable;
class EditResponse implements Responsable
{
/**
* @var \App\Models\Access\User\User
*/
protected $user;
/**
* @var \App\Models\Access\Permission\Permission
*/
protected $permissions;
/**
* @var \App\Models\Access\Role\Role
*/
protected $roles;
/**
* @param \App\Models\Access\User\User $user
*/
public function __construct($user, $roles, $permissions)
{
$this->user = $user;
$this->roles = $roles;
$this->permissions = $permissions;
}
/**
* toReponse.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
$permissions = $this->permissions;
$userPermissions = $this->user->permissions()->get()->pluck('id')->toArray();
return view('backend.access.users.edit')->with([
'user' => $this->user,
'userRoles' => $this->user->roles->pluck('id')->all(),
'roles' => $this->roles,
'userPermissions' => $userPermissions,
'permissions' => $permissions,
]);
}
}
<?php
namespace App\Http\Responses\Backend\Access\User;
use Illuminate\Contracts\Support\Responsable;
class ShowResponse implements Responsable
{
/**
* @var \App\Models\Access\User\User
*/
protected $user;
/**
* @param \App\Models\Access\User\User $user
*/
public function __construct($user)
{
$this->user = $user;
}
/**
* In Response.
*
* @param \App\Http\Requests\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.access.users.show')->withUser($this->user);
}
}
<?php
namespace App\Http\Responses\Backend\Blog;
use Illuminate\Contracts\Support\Responsable;
class CreateResponse implements Responsable
{
protected $status;
protected $blogTags;
protected $blogCategories;
public function __construct($status, $blogCategories, $blogTags)
{
$this->status = $status;
$this->blogTags = $blogTags;
$this->blogCategories = $blogCategories;
}
public function toResponse($request)
{
return view('backend.blogs.create')->with([
'blogCategories' => $this->blogCategories,
'blogTags' => $this->blogTags,
'status' => $this->status,
]);
}
}
<?php
namespace App\Http\Responses\Backend\Blog;
use Illuminate\Contracts\Support\Responsable;
class EditResponse implements Responsable
{
protected $blog;
protected $status;
protected $blogTags;
protected $blogCategories;
public function __construct($blog, $status, $blogCategories, $blogTags)
{
$this->blog = $blog;
$this->status = $status;
$this->blogTags = $blogTags;
$this->blogCategories = $blogCategories;
}
public function toResponse($request)
{
$selectedCategories = $this->blog->categories->pluck('id')->toArray();
$selectedtags = $this->blog->tags->pluck('id')->toArray();
return view('backend.blogs.edit')->with([
'blog' => $this->blog,
'blogCategories' => $this->blogCategories,
'blogTags' => $this->blogTags,
'selectedCategories' => $selectedCategories,
'selectedtags' => $selectedtags,
'status' => $this->status,
]);
}
}
<?php
namespace App\Http\Responses\Backend\Blog;
use Illuminate\Contracts\Support\Responsable;
class IndexResponse implements Responsable
{
protected $status;
public function __construct($status)
{
$this->status = $status;
}
public function toResponse($request)
{
return view('backend.blogs.index')->with([
'status'=> $this->status,
]);
}
}
<?php
namespace App\Http\Responses\Backend\Menu;
use Illuminate\Contracts\Support\Responsable;
class EditResponse implements Responsable
{
/**
* @var \App\Models\BlogCategories\BlogCategory
*/
protected $blogCategory;
/**
* @param \App\Models\BlogCategories\BlogCategory $blogCategory
*/
public function __construct($blogCategory, $types, $modules)
{
$this->blogCategory = $blogCategory;
}
/**
* toReponse.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.blogcategories.edit')
->with('blogcategory', $this->blogCategory);
}
}
<?php
namespace App\Http\Responses\Backend\BlogTag;
use Illuminate\Contracts\Support\Responsable;
class EditResponse implements Responsable
{
/**
* @var \App\Models\BlogTags\BlogTag
*/
protected $blogTag;
/**
* @param \App\Models\BlogTags\BlogTag $blogTag
*/
public function __construct($blogTag)
{
$this->blogTag = $blogTag;
}
/**
* toReponse.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.blogtags.edit')
->with('blogtag', $this->blogTag);
}
}
<?php
namespace App\Http\Responses\Backend\Faq;
use Illuminate\Contracts\Support\Responsable;
class EditResponse implements Responsable
{
/**
* @var \App\Models\Faqs\Faq
*/
protected $faq;
/**
* @param \App\Models\Faqs\Faq $faq
*/
public function __construct($faq)
{
$this->faq = $faq;
}
/**
* toReponse.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.faqs.edit')
->with('faq', $this->faq);
}
}
<?php
namespace App\Http\Responses\Backend\Menu;
use Illuminate\Contracts\Support\Responsable;
class CreateResponse implements Responsable
{
/**
* @var array
*/
protected $types;
/**
* @var \Bvipul\Generator\Module
*/
protected $modules;
/**
* @param array $types
* @param \Bvipul\Generator\Module $modules
*/
public function __construct($types, $modules)
{
$this->types = $types;
$this->modules = $modules;
}
/**
* In Response.
*
* @param \App\Http\Requests\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.menus.create')
->withTypes($this->types)
->withModules($this->modules->all());
}
}
<?php
namespace App\Http\Responses\Backend\Menu;
use Illuminate\Contracts\Support\Responsable;
class EditResponse implements Responsable
{
/**
* @var array
*/
protected $types;
/**
* @var \Bvipul\Generator\Module
*/
protected $modules;
/**
* @var \App\Models\Menu\Menu
*/
protected $menu;
/**
* @param \App\Models\Menu\Menu $menu
* @param array $types
* @param \Bvipul\Generator\Module $modules
*/
public function __construct($menu, $types, $modules)
{
$this->menu = $menu;
$this->types = $types;
$this->modules = $modules;
}
/**
* toReponse.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.menus.edit')
->with('types', $this->types)
->with('menu', $this->menu)
->with('modules', $this->modules->all());
}
}
<?php
namespace App\Http\Responses\Backend\Page;
use Illuminate\Contracts\Support\Responsable;
class EditResponse implements Responsable
{
/**
* @var \App\Models\Page\Page
*/
protected $page;
/**
* @param \App\Models\Page\Page $page
*/
public function __construct($page)
{
$this->page = $page;
}
/**
* toReponse.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.pages.edit')
->withPage($this->page);
}
}
<?php
namespace App\Http\Responses\Backend\Setting;
use Illuminate\Contracts\Support\Responsable;
class EditResponse implements Responsable
{
/**
* @var \App\Models\Settings\Setting
*/
protected $setting;
/**
* @param \App\Models\Settings\Setting $setting
*/
public function __construct($setting)
{
$this->setting = $setting;
}
/**
* toReponse.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
return view('backend.settings.edit')
->withSetting($this->setting);
}
}
<?php
namespace App\Http\Responses;
use Illuminate\Contracts\Support\Responsable;
class RedirectResponse implements Responsable
{
protected $route;
protected $message;
public function __construct($route, $message)
{
$this->route = $route;
$this->message = $message;
}
public function toResponse($request)
{
return redirect()
->to($this->route)
->with($this->message);
}
}
<?php
namespace App\Http\Responses;
use Illuminate\Contracts\Support\Responsable;
class ViewResponse implements Responsable
{
/**
* @var string
*/
protected $view;
/**
* @var array
*/
protected $with;
/**
* @param string $view
* @param array $with
*/
public function __construct($view, $with = [])
{
$this->view = $view;
$this->with = $with;
}
/**
* In Response.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function toResponse($request)
{
if (!empty($this->with)) {
return view($this->view)->with($this->with);
}
return view($this->view);
}
}
<?php
namespace App\Providers;
use App\Helpers\Macros\Macros;
use Collective\Html\HtmlServiceProvider;
/**
* Class MacroServiceProvider.
*/
class MacroServiceProvider extends HtmlServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
parent::register();
$this->app->singleton('form', function ($app) {
$form = new Macros($app['html'], $app['url'], $app['view'], $app['session.store']->token());
return $form->setSessionStore($app['session.store']);
});
}
}
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "47881206fa716e06d6d48b9a4881de4e",
"content-hash": "529102fbc0fdd6142c7a86d0c99443c6",
"packages": [
{
"name": "arcanedev/log-viewer",
......@@ -623,16 +623,16 @@
},
{
"name": "doctrine/dbal",
"version": "v2.7.0",
"version": "v2.7.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "f76bf5ef631cec551a86c2291fc749534febebf1"
"reference": "11037b4352c008373561dc6fc836834eed80c3b5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/f76bf5ef631cec551a86c2291fc749534febebf1",
"reference": "f76bf5ef631cec551a86c2291fc749534febebf1",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/11037b4352c008373561dc6fc836834eed80c3b5",
"reference": "11037b4352c008373561dc6fc836834eed80c3b5",
"shasum": ""
},
"require": {
......@@ -694,7 +694,7 @@
"persistence",
"queryobject"
],
"time": "2018-04-01T23:33:17+00:00"
"time": "2018-04-07T18:44:18+00:00"
},
{
"name": "doctrine/inflector",
......@@ -819,23 +819,23 @@
},
{
"name": "dragonmantank/cron-expression",
"version": "v2.0.0",
"version": "v2.1.0",
"source": {
"type": "git",
"url": "https://github.com/dragonmantank/cron-expression.git",
"reference": "8a84aee649c3a3ba03a721c1fb080e08dfbcd68b"
"reference": "3f00985deec8df53d4cc1e5c33619bda1ee309a5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8a84aee649c3a3ba03a721c1fb080e08dfbcd68b",
"reference": "8a84aee649c3a3ba03a721c1fb080e08dfbcd68b",
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/3f00985deec8df53d4cc1e5c33619bda1ee309a5",
"reference": "3f00985deec8df53d4cc1e5c33619bda1ee309a5",
"shasum": ""
},
"require": {
"php": ">=7.0.0"
},
"require-dev": {
"phpunit/phpunit": "~5.7"
"phpunit/phpunit": "~6.4"
},
"type": "library",
"autoload": {
......@@ -864,20 +864,20 @@
"cron",
"schedule"
],
"time": "2017-10-12T15:59:13+00:00"
"time": "2018-04-06T15:51:55+00:00"
},
{
"name": "egulias/email-validator",
"version": "2.1.3",
"version": "2.1.4",
"source": {
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
"reference": "1bec00a10039b823cc94eef4eddd47dcd3b2ca04"
"reference": "8790f594151ca6a2010c6218e09d96df67173ad3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/1bec00a10039b823cc94eef4eddd47dcd3b2ca04",
"reference": "1bec00a10039b823cc94eef4eddd47dcd3b2ca04",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/8790f594151ca6a2010c6218e09d96df67173ad3",
"reference": "8790f594151ca6a2010c6218e09d96df67173ad3",
"shasum": ""
},
"require": {
......@@ -886,7 +886,7 @@
},
"require-dev": {
"dominicsayers/isemail": "dev-master",
"phpunit/phpunit": "^4.8.35",
"phpunit/phpunit": "^4.8.35||^5.7||^6.0",
"satooshi/php-coveralls": "^1.0.1"
},
"suggest": {
......@@ -921,7 +921,7 @@
"validation",
"validator"
],
"time": "2017-11-15T23:40:40+00:00"
"time": "2018-04-10T10:11:19+00:00"
},
{
"name": "erusev/parsedown",
......@@ -1426,16 +1426,16 @@
},
{
"name": "laravel/framework",
"version": "v5.6.15",
"version": "v5.6.17",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "baa42cf6bdd942523fafece21ec16a1843c6db0f"
"reference": "0f787c763ae8fb9fae0c8c809830ba4fa81e2d9d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/baa42cf6bdd942523fafece21ec16a1843c6db0f",
"reference": "baa42cf6bdd942523fafece21ec16a1843c6db0f",
"url": "https://api.github.com/repos/laravel/framework/zipball/0f787c763ae8fb9fae0c8c809830ba4fa81e2d9d",
"reference": "0f787c763ae8fb9fae0c8c809830ba4fa81e2d9d",
"shasum": ""
},
"require": {
......@@ -1446,7 +1446,7 @@
"ext-openssl": "*",
"league/flysystem": "^1.0.8",
"monolog/monolog": "~1.12",
"nesbot/carbon": "^1.24.1",
"nesbot/carbon": "1.25.*",
"php": "^7.1.3",
"psr/container": "~1.0",
"psr/simple-cache": "^1.0",
......@@ -1500,6 +1500,7 @@
"aws/aws-sdk-php": "~3.0",
"doctrine/dbal": "~2.6",
"filp/whoops": "^2.1.4",
"league/flysystem-cached-adapter": "~1.0",
"mockery/mockery": "~1.0",
"moontoast/math": "^1.1",
"orchestra/testbench-core": "3.6.*",
......@@ -1518,7 +1519,7 @@
"guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).",
"laravel/tinker": "Required to use the tinker console command (~1.0).",
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).",
"league/flysystem-cached-adapter": "Required to use Flysystem caching (~1.0).",
"league/flysystem-cached-adapter": "Required to use the Flysystem cache (~1.0).",
"league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).",
"league/flysystem-sftp": "Required to use the Flysystem SFTP driver (~1.0).",
"nexmo/client": "Required to use the Nexmo transport (~1.0).",
......@@ -1560,7 +1561,7 @@
"framework",
"laravel"
],
"time": "2018-03-30T13:29:58+00:00"
"time": "2018-04-17T12:51:04+00:00"
},
{
"name": "laravel/socialite",
......@@ -1626,16 +1627,16 @@
},
{
"name": "laravel/tinker",
"version": "v1.0.5",
"version": "v1.0.6",
"source": {
"type": "git",
"url": "https://github.com/laravel/tinker.git",
"reference": "94f6daf2131508cebd11cd6f8632ba586d7ecc41"
"reference": "b22fe905fcefdffae76b011e27c7ac09e07e052b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/tinker/zipball/94f6daf2131508cebd11cd6f8632ba586d7ecc41",
"reference": "94f6daf2131508cebd11cd6f8632ba586d7ecc41",
"url": "https://api.github.com/repos/laravel/tinker/zipball/b22fe905fcefdffae76b011e27c7ac09e07e052b",
"reference": "b22fe905fcefdffae76b011e27c7ac09e07e052b",
"shasum": ""
},
"require": {
......@@ -1643,7 +1644,7 @@
"illuminate/contracts": "~5.1",
"illuminate/support": "~5.1",
"php": ">=5.5.9",
"psy/psysh": "0.7.*|0.8.*",
"psy/psysh": "0.7.*|0.8.*|0.9.*",
"symfony/var-dumper": "~3.0|~4.0"
},
"require-dev": {
......@@ -1685,20 +1686,20 @@
"laravel",
"psysh"
],
"time": "2018-03-06T17:34:36+00:00"
"time": "2018-04-16T12:10:37+00:00"
},
{
"name": "laravelcollective/html",
"version": "v5.6.5",
"version": "v5.6.6",
"source": {
"type": "git",
"url": "https://github.com/LaravelCollective/html.git",
"reference": "623a150c91e2d3f92eeee9f9eda58a841e3cb548"
"reference": "b3a10245c791a211e5f8ec37117f4549cd22aabe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/LaravelCollective/html/zipball/623a150c91e2d3f92eeee9f9eda58a841e3cb548",
"reference": "623a150c91e2d3f92eeee9f9eda58a841e3cb548",
"url": "https://api.github.com/repos/LaravelCollective/html/zipball/b3a10245c791a211e5f8ec37117f4549cd22aabe",
"reference": "b3a10245c791a211e5f8ec37117f4549cd22aabe",
"shasum": ""
},
"require": {
......@@ -1753,7 +1754,7 @@
],
"description": "HTML and Form Builders for the Laravel Framework",
"homepage": "https://laravelcollective.com",
"time": "2018-03-16T16:57:31+00:00"
"time": "2018-04-09T14:09:32+00:00"
},
{
"name": "lcobucci/jwt",
......@@ -1815,16 +1816,16 @@
},
{
"name": "league/flysystem",
"version": "1.0.43",
"version": "1.0.44",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "1ce7cc142d906ba58dc54c82915d355a9191c8a8"
"reference": "168dbe519737221dc87d17385cde33073881fd02"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/1ce7cc142d906ba58dc54c82915d355a9191c8a8",
"reference": "1ce7cc142d906ba58dc54c82915d355a9191c8a8",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/168dbe519737221dc87d17385cde33073881fd02",
"reference": "168dbe519737221dc87d17385cde33073881fd02",
"shasum": ""
},
"require": {
......@@ -1895,7 +1896,7 @@
"sftp",
"storage"
],
"time": "2018-03-01T10:27:04+00:00"
"time": "2018-04-06T09:58:14+00:00"
},
{
"name": "league/oauth1-client",
......@@ -2156,24 +2157,24 @@
},
{
"name": "nikic/php-parser",
"version": "v3.1.5",
"version": "v4.0.1",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce"
"reference": "e4a54fa90a5cd8e8dd3fb4099942681731c5cdd3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce",
"reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e4a54fa90a5cd8e8dd3fb4099942681731c5cdd3",
"reference": "e4a54fa90a5cd8e8dd3fb4099942681731c5cdd3",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.5"
"php": ">=7.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0|~5.0"
"phpunit/phpunit": "^6.5 || ^7.0"
},
"bin": [
"bin/php-parse"
......@@ -2181,7 +2182,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "4.0-dev"
}
},
"autoload": {
......@@ -2203,20 +2204,20 @@
"parser",
"php"
],
"time": "2018-02-28T20:30:58+00:00"
"time": "2018-03-25T17:35:16+00:00"
},
{
"name": "paragonie/random_compat",
"version": "v2.0.11",
"version": "v2.0.12",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8"
"reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8",
"reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb",
"reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb",
"shasum": ""
},
"require": {
......@@ -2251,7 +2252,7 @@
"pseudorandom",
"random"
],
"time": "2017-09-27T21:40:39+00:00"
"time": "2018-04-04T21:24:14+00:00"
},
{
"name": "psr/container",
......@@ -2449,29 +2450,29 @@
},
{
"name": "psy/psysh",
"version": "v0.8.18",
"version": "v0.9.3",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
"reference": "5357b1cffc8fb375d6a9e3c86d5c82dd38a40834"
"reference": "79c280013cf0b30fa23f3ba8bd3649218075adf4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/5357b1cffc8fb375d6a9e3c86d5c82dd38a40834",
"reference": "5357b1cffc8fb375d6a9e3c86d5c82dd38a40834",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/79c280013cf0b30fa23f3ba8bd3649218075adf4",
"reference": "79c280013cf0b30fa23f3ba8bd3649218075adf4",
"shasum": ""
},
"require": {
"dnoegel/php-xdg-base-dir": "0.1",
"jakub-onderka/php-console-highlighter": "0.3.*",
"nikic/php-parser": "~1.3|~2.0|~3.0",
"php": ">=5.3.9",
"nikic/php-parser": "~1.3|~2.0|~3.0|~4.0",
"php": ">=5.4.0",
"symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0",
"symfony/var-dumper": "~2.7|~3.0|~4.0"
},
"require-dev": {
"hoa/console": "~3.16|~1.14",
"phpunit/phpunit": "^4.8.35|^5.4.3",
"hoa/console": "~2.15|~3.16",
"phpunit/phpunit": "~4.8.35|~5.0|~6.0|~7.0",
"symfony/finder": "~2.1|~3.0|~4.0"
},
"suggest": {
......@@ -2487,15 +2488,15 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "0.8.x-dev"
"dev-develop": "0.9.x-dev"
}
},
"autoload": {
"files": [
"src/Psy/functions.php"
"src/functions.php"
],
"psr-4": {
"Psy\\": "src/Psy/"
"Psy\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
......@@ -2517,7 +2518,7 @@
"interactive",
"shell"
],
"time": "2018-04-02T05:41:44+00:00"
"time": "2018-04-18T12:32:50+00:00"
},
{
"name": "ramsey/uuid",
......@@ -2715,7 +2716,7 @@
},
{
"name": "symfony/console",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
......@@ -2783,7 +2784,7 @@
},
{
"name": "symfony/css-selector",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
......@@ -2836,7 +2837,7 @@
},
{
"name": "symfony/debug",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
......@@ -2892,16 +2893,16 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "85eaf6a8ec915487abac52e133efc4a268204428"
"reference": "63353a71073faf08f62caab4e6889b06a787f07b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/85eaf6a8ec915487abac52e133efc4a268204428",
"reference": "85eaf6a8ec915487abac52e133efc4a268204428",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/63353a71073faf08f62caab4e6889b06a787f07b",
"reference": "63353a71073faf08f62caab4e6889b06a787f07b",
"shasum": ""
},
"require": {
......@@ -2951,20 +2952,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2018-02-14T14:11:10+00:00"
"time": "2018-04-06T07:35:43+00:00"
},
{
"name": "symfony/finder",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "c72995d9f5999b3fcdd8660c0c9690243252e1e1"
"reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/c72995d9f5999b3fcdd8660c0c9690243252e1e1",
"reference": "c72995d9f5999b3fcdd8660c0c9690243252e1e1",
"url": "https://api.github.com/repos/symfony/finder/zipball/ca27c02b7a3fef4828c998c2ff9ba7aae1641c49",
"reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49",
"shasum": ""
},
"require": {
......@@ -3000,11 +3001,11 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2018-04-02T09:52:41+00:00"
"time": "2018-04-04T05:10:37+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
......@@ -3057,16 +3058,16 @@
},
{
"name": "symfony/http-kernel",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "38337d03a554a2b0e9f553d368723692b7c04a8f"
"reference": "6dd620d96d64456075536ffe3c6c4658dd689021"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/38337d03a554a2b0e9f553d368723692b7c04a8f",
"reference": "38337d03a554a2b0e9f553d368723692b7c04a8f",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/6dd620d96d64456075536ffe3c6c4658dd689021",
"reference": "6dd620d96d64456075536ffe3c6c4658dd689021",
"shasum": ""
},
"require": {
......@@ -3139,7 +3140,7 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"time": "2018-04-03T06:20:33+00:00"
"time": "2018-04-06T16:25:03+00:00"
},
{
"name": "symfony/polyfill-mbstring",
......@@ -3365,7 +3366,7 @@
},
{
"name": "symfony/process",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
......@@ -3414,16 +3415,16 @@
},
{
"name": "symfony/routing",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "ca780c838046bfef4a6fd50284ae71a5d1f1a8b2"
"reference": "0663036dd57dbfd4e9ff29f75bbd5dd3253ebe71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/ca780c838046bfef4a6fd50284ae71a5d1f1a8b2",
"reference": "ca780c838046bfef4a6fd50284ae71a5d1f1a8b2",
"url": "https://api.github.com/repos/symfony/routing/zipball/0663036dd57dbfd4e9ff29f75bbd5dd3253ebe71",
"reference": "0663036dd57dbfd4e9ff29f75bbd5dd3253ebe71",
"shasum": ""
},
"require": {
......@@ -3488,11 +3489,11 @@
"uri",
"url"
],
"time": "2018-04-02T09:52:41+00:00"
"time": "2018-04-04T13:50:32+00:00"
},
{
"name": "symfony/translation",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
......@@ -3560,16 +3561,16 @@
},
{
"name": "symfony/var-dumper",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "f9b257f2009c7f09166bcfd3d3d96455741ed371"
"reference": "e1b4d008100f4d203cc38b0d793ad6252d8d8af0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/f9b257f2009c7f09166bcfd3d3d96455741ed371",
"reference": "f9b257f2009c7f09166bcfd3d3d96455741ed371",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/e1b4d008100f4d203cc38b0d793ad6252d8d8af0",
"reference": "e1b4d008100f4d203cc38b0d793ad6252d8d8af0",
"shasum": ""
},
"require": {
......@@ -3625,7 +3626,7 @@
"debug",
"dump"
],
"time": "2018-04-03T05:24:00+00:00"
"time": "2018-04-04T05:10:37+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
......@@ -3875,16 +3876,16 @@
},
{
"name": "yajra/laravel-datatables-oracle",
"version": "v8.4.2",
"version": "v8.4.3",
"source": {
"type": "git",
"url": "https://github.com/yajra/laravel-datatables.git",
"reference": "eab6cc583ae778d056c5caf21b70db803d956e14"
"reference": "9a87175e5ca02627aec98ec767fce5f5cbc98177"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/eab6cc583ae778d056c5caf21b70db803d956e14",
"reference": "eab6cc583ae778d056c5caf21b70db803d956e14",
"url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/9a87175e5ca02627aec98ec767fce5f5cbc98177",
"reference": "9a87175e5ca02627aec98ec767fce5f5cbc98177",
"shasum": ""
},
"require": {
......@@ -3942,7 +3943,7 @@
"jquery",
"laravel"
],
"time": "2018-03-28T16:31:13+00:00"
"time": "2018-04-05T14:51:57+00:00"
}
],
"packages-dev": [
......@@ -4016,16 +4017,16 @@
},
{
"name": "bvipul/generator",
"version": "0.9.3",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/bvipul/generator.git",
"reference": "9aa7d1aa9c2c748fa3890ab25628ea2cd7042103"
"reference": "18b79a924aa40ee0c199c0cd65a454db1be55d42"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bvipul/generator/zipball/9aa7d1aa9c2c748fa3890ab25628ea2cd7042103",
"reference": "9aa7d1aa9c2c748fa3890ab25628ea2cd7042103",
"url": "https://api.github.com/repos/bvipul/generator/zipball/18b79a924aa40ee0c199c0cd65a454db1be55d42",
"reference": "18b79a924aa40ee0c199c0cd65a454db1be55d42",
"shasum": ""
},
"type": "package",
......@@ -4045,7 +4046,7 @@
}
],
"description": "To create a whole module with all related files like model, controller, repository, routes, views etc with a simple GUI.",
"time": "2017-12-16T18:48:20+00:00"
"time": "2018-04-13T17:56:21+00:00"
},
{
"name": "codedungeon/phpunit-result-printer",
......@@ -4838,23 +4839,23 @@
},
{
"name": "phpspec/prophecy",
"version": "1.7.5",
"version": "1.7.6",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401"
"reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401",
"reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
"reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
"sebastian/comparator": "^1.1|^2.0",
"sebastian/comparator": "^1.1|^2.0|^3.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0"
},
"require-dev": {
......@@ -4897,20 +4898,20 @@
"spy",
"stub"
],
"time": "2018-02-19T10:16:54+00:00"
"time": "2018-04-18T13:57:24+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "6.0.1",
"version": "6.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "f8ca4b604baf23dab89d87773c28cc07405189ba"
"reference": "774a82c0c5da4c1c7701790c262035d235ab7856"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f8ca4b604baf23dab89d87773c28cc07405189ba",
"reference": "f8ca4b604baf23dab89d87773c28cc07405189ba",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/774a82c0c5da4c1c7701790c262035d235ab7856",
"reference": "774a82c0c5da4c1c7701790c262035d235ab7856",
"shasum": ""
},
"require": {
......@@ -4921,7 +4922,7 @@
"phpunit/php-text-template": "^1.2.1",
"phpunit/php-token-stream": "^3.0",
"sebastian/code-unit-reverse-lookup": "^1.0.1",
"sebastian/environment": "^3.0",
"sebastian/environment": "^3.1",
"sebastian/version": "^2.0.1",
"theseer/tokenizer": "^1.1"
},
......@@ -4960,7 +4961,7 @@
"testing",
"xunit"
],
"time": "2018-02-02T07:01:41+00:00"
"time": "2018-04-06T15:39:20+00:00"
},
{
"name": "phpunit/php-file-iterator",
......@@ -5150,16 +5151,16 @@
},
{
"name": "phpunit/phpunit",
"version": "7.0.3",
"version": "7.1.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "536f4d853c12d8189963435088e8ff7c0daeab2e"
"reference": "6d51299e307dc510149e0b7cd1931dd11770e1cb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/536f4d853c12d8189963435088e8ff7c0daeab2e",
"reference": "536f4d853c12d8189963435088e8ff7c0daeab2e",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6d51299e307dc510149e0b7cd1931dd11770e1cb",
"reference": "6d51299e307dc510149e0b7cd1931dd11770e1cb",
"shasum": ""
},
"require": {
......@@ -5177,8 +5178,8 @@
"phpunit/php-file-iterator": "^1.4.3",
"phpunit/php-text-template": "^1.2.1",
"phpunit/php-timer": "^2.0",
"phpunit/phpunit-mock-objects": "^6.0",
"sebastian/comparator": "^2.1",
"phpunit/phpunit-mock-objects": "^6.1.1",
"sebastian/comparator": "^2.1 || ^3.0",
"sebastian/diff": "^3.0",
"sebastian/environment": "^3.1",
"sebastian/exporter": "^3.1",
......@@ -5200,7 +5201,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "7.0-dev"
"dev-master": "7.1-dev"
}
},
"autoload": {
......@@ -5226,20 +5227,20 @@
"testing",
"xunit"
],
"time": "2018-03-26T07:36:48+00:00"
"time": "2018-04-18T13:41:53+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "6.0.1",
"version": "6.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "e3249dedc2d99259ccae6affbc2684eac37c2e53"
"reference": "70c740bde8fd9ea9ea295be1cd875dd7b267e157"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/e3249dedc2d99259ccae6affbc2684eac37c2e53",
"reference": "e3249dedc2d99259ccae6affbc2684eac37c2e53",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/70c740bde8fd9ea9ea295be1cd875dd7b267e157",
"reference": "70c740bde8fd9ea9ea295be1cd875dd7b267e157",
"shasum": ""
},
"require": {
......@@ -5257,7 +5258,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.0.x-dev"
"dev-master": "6.1-dev"
}
},
"autoload": {
......@@ -5282,7 +5283,7 @@
"mock",
"xunit"
],
"time": "2018-02-15T05:27:38+00:00"
"time": "2018-04-11T04:50:36+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
......@@ -5331,30 +5332,30 @@
},
{
"name": "sebastian/comparator",
"version": "2.1.3",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "34369daee48eafb2651bea869b4b15d75ccc35f9"
"reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9",
"reference": "34369daee48eafb2651bea869b4b15d75ccc35f9",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ed5fd2281113729f1ebcc64d101ad66028aeb3d5",
"reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5",
"shasum": ""
},
"require": {
"php": "^7.0",
"sebastian/diff": "^2.0 || ^3.0",
"php": "^7.1",
"sebastian/diff": "^3.0",
"sebastian/exporter": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "^6.4"
"phpunit/phpunit": "^7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
"dev-master": "3.0-dev"
}
},
"autoload": {
......@@ -5391,7 +5392,7 @@
"compare",
"equality"
],
"time": "2018-02-01T13:46:46+00:00"
"time": "2018-04-18T13:33:00+00:00"
},
{
"name": "sebastian/diff",
......@@ -5849,7 +5850,7 @@
},
{
"name": "symfony/dom-crawler",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
......@@ -5905,7 +5906,7 @@
},
{
"name": "symfony/yaml",
"version": "v4.0.7",
"version": "v4.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
......@@ -6161,7 +6162,8 @@
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"tymon/jwt-auth": 20
"tymon/jwt-auth": 20,
"bvipul/generator": 20
},
"prefer-stable": false,
"prefer-lowest": false,
......
......@@ -198,7 +198,6 @@ return [
App\Providers\ComposerServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\HistoryServiceProvider::class,
App\Providers\MacroServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Tymon\JWTAuth\Providers\LaravelServiceProvider::class,
Bvipul\Generator\Provider\CrudGeneratorServiceProvider::class,
......
......@@ -56,7 +56,7 @@ return [
*/
'from' => [
'address' => env('MAIL_USERNAME', 'viral.solani@gmail.com'),
'address' => env('MAIL_FROM', 'viral.solani@gmail.com'),
'name' => env('MAIL_FROM_NAME', 'Admin'),
],
......
FROM ubuntu:16.04
RUN apt-get update \
&& apt-get install -qy language-pack-en-base \
&& locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
RUN apt-get -y install apache2
RUN a2enmod headers
RUN a2enmod rewrite
# add PPA for PHP 7
RUN apt-get install -y --no-install-recommends apt-utils
RUN apt update
RUN apt -y dist-upgrade
RUN apt remove --purge ca-certificates
RUN apt autoremove
RUN apt install ca-certificates
RUN apt-get install -y software-properties-common python-software-properties
RUN add-apt-repository -y ppa:ondrej/php
# Adding php 7
RUN apt-get update
RUN apt-get install -y php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-zip
RUN apt-get -y install libapache2-mod-php7.1 php7.1 php7.1-cli php-xdebug php7.1-mbstring sqlite3 php7.1-mysql php-imagick php-memcached php-pear curl imagemagick php7.1-dev php7.1-phpdbg php7.1-gd npm nodejs-legacy php7.1-json php7.1-curl php7.1-sqlite3 php7.1-intl apache2 vim git-core wget libsasl2-dev libssl-dev
RUN apt-get -y install libsslcommon2-dev libcurl4-openssl-dev autoconf g++ make openssl libssl-dev libcurl4-openssl-dev pkg-config libsasl2-dev libpcre3-dev
RUN apt-get install -y imagemagick graphicsmagick
RUN a2enmod headers
RUN a2enmod rewrite
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
RUN ln -sf /dev/stdout /var/log/apache2/access.log && \
ln -sf /dev/stderr /var/log/apache2/error.log
RUN mkdir -p $APACHE_RUN_DIR $APACHE_LOCK_DIR $APACHE_LOG_DIR
# Update application repository list and install the Redis server.
#RUN apt-get update && apt-get install -y redis-server
# Allow Composer to be run as root
ENV COMPOSER_ALLOW_SUPERUSER 1
# Setup the Composer installer
RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
&& curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
&& php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" \
&& php /tmp/composer-setup.php \
&& chmod a+x composer.phar \
&& mv composer.phar /usr/local/bin/composer
# Install composer dependencies
RUN echo pwd: `pwd` && echo ls: `ls`
# RUN composer install
EXPOSE 80
# Expose default port
#EXPOSE 6379
VOLUME [ "/var/www/html" ,"/etc/mysql"]
WORKDIR /var/www/html
ENTRYPOINT [ "/usr/sbin/apache2" ]
CMD ["-D", "FOREGROUND"]
COPY . /var/www/html
COPY ./deploy/vhost.conf /etc/apache2/sites-available/000-default.conf
RUN chown -R www-data:www-data /var/www/html \
&& a2enmod rewrite
RUN chown -R 777 /var/www/html/
RUN composer install
RUN php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"
<VirtualHost *:80>
DocumentRoot /var/www/html/public
<Directory "/var/www/html/public">
AllowOverride all
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
\ No newline at end of file
version: '3'
services:
app:
image: inshastri/laravel-adminpanel:latest
ports:
- 80:80
- 8080:8080
links:
- mysql
- redis
environment:
DB_HOST: mysql
DB_DATABASE: laravel_docker
DB_USERNAME: root
DB_PASSWORD: toor
REDIS_HOST: redis
SESSION_DRIVER: redis
CACHE_DRIVER: redis
networks:
- testservice_bridge2
mysql:
image: mysql:5
volumes:
- ./data:/var/lib/mysql
ports:
- 3306:3306
restart: always
environment:
MYSQL_ROOT_PASSWORD: toor
MYSQL_DATABASE: laravel_docker
networks:
- testservice_bridge2
redis:
image: redis:4.0-alpine
ports:
- 6379:6379
networks:
- testservice_bridge2
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
PMA_PORT: 3306
PMA_HOST: mysql
PMA_USER: root
PMA_PASSWORD: toor
ports:
- "8005:80"
restart: always
depends_on:
- mysql
networks:
- testservice_bridge2
networks:
testservice_bridge2:
//common functionalities for all the javascript featueres
var Backend = {}; // common variable used in all the files of the backend
(function (){
(function () {
Backend = {
......@@ -55,10 +55,10 @@ var Backend = {}; // common variable used in all the files of the backend
}
request.open(method, url, true);
request.onloadstart = function() {
request.onloadstart = function () {
loadingIcon.show();
};
request.onloadend = function() {
request.onloadend = function () {
loadingIcon.hide();
};
request.setRequestHeader('X-CSRF-TOKEN', csrf);
......@@ -101,8 +101,7 @@ var Backend = {}; // common variable used in all the files of the backend
* Pages
*
*/
Pages:
{
Pages: {
init: function () {
Backend.tinyMCE.init();
},
......@@ -111,13 +110,12 @@ var Backend = {}; // common variable used in all the files of the backend
/**
* Roles management
*/
Roles:
{
Roles: {
selectors: {
associated: document.querySelector("select[name='associated_permissions']"),
associated_container: document.getElementById("#available-permissions"),
},
init(page) {
init: function (page) {
this.setSelectors();
this.setRolepermission(page);
this.addHandlers();
......@@ -154,8 +152,7 @@ var Backend = {}; // common variable used in all the files of the backend
* Users management
*
*/
Users:
{
Users: {
selectors: {
select2: jQuery(".select2"),
getPremissionURL: "",
......@@ -218,8 +215,10 @@ var Backend = {}; // common variable used in all the files of the backend
}
};
Backend.Utils.ajaxrequest(Backend.Users.selectors.getPremissionURL, "post", { role_id: event.target.value }, Backend.Utils.csrf, callback);
}
Backend.Utils.ajaxrequest(Backend.Users.selectors.getPremissionURL, "post", {
role_id: event.target.value
}, Backend.Utils.csrf, callback);
};
});
if (page == "create") {
Backend.Users.selectors.Role3.click();
......@@ -257,8 +256,7 @@ var Backend = {}; // common variable used in all the files of the backend
*
*/
UserDeleted:
{
UserDeleted: {
selectors: {
AlldeletePerms: document.querySelectorAll("a[name='delete_user_perm']"),
AllrestorePerms: document.querySelectorAll("a[name='restore_user']"),
......@@ -330,8 +328,7 @@ var Backend = {}; // common variable used in all the files of the backend
* Blog
*
*/
Blog:
{
Blog: {
selectors: {
tags: jQuery(".tags"),
categories: jQuery(".categories"),
......@@ -377,15 +374,16 @@ var Backend = {}; // common variable used in all the files of the backend
}
};
Backend.Utils.ajaxrequest(Backend.Blog.selectors.GenerateSlugUrl, "post", { text: url }, Backend.Utils.csrf, callback);
Backend.Utils.ajaxrequest(Backend.Blog.selectors.GenerateSlugUrl, "post", {
text: url
}, Backend.Utils.csrf, callback);
}
};
}
},
Menu:
{
Menu: {
selectors: {
menuItemContainer: jQuery("#menu-items"),
menuItemsData: jQuery(".menu-items-field"),
......@@ -394,16 +392,16 @@ var Backend = {}; // common variable used in all the files of the backend
document: jQuery("document"),
addCustomUrlForm: "#menu-add-custom-url",
addModuleToMenuButton: ".add-module-to-menu",
removeMenuItemButton : ".remove-menu-item",
editMenuItemButton : ".edit-menu-item",
removeMenuItemButton: ".remove-menu-item",
editMenuItemButton: ".edit-menu-item",
formUrl: "",
},
methods: {
getNewId : function(str) {
getNewId: function (str) {
var arr = str.match(/"id":[0-9]+/gi);
if(arr) {
$.each(arr, function(index, item) {
if (arr) {
$.each(arr, function (index, item) {
arr[index] = parseInt(item.replace('"id":', ''));
});
return Math.max.apply(Math, arr) + 1;
......@@ -411,36 +409,34 @@ var Backend = {}; // common variable used in all the files of the backend
return 1;
},
findItemById : function(item, id) {
if(item.id == id) {
findItemById: function (item, id) {
if (item.id == id) {
return item;
}
var found = false;
var foundItem;
if(item.children){
$.each(item.children, function(index, childItem){
if (item.children) {
$.each(item.children, function (index, childItem) {
foundItem = Backend.Menu.methods.findItemById(childItem, id);
if(foundItem)
{
if (foundItem) {
found = true;
return false;
}
});
}
if(found)
{
if (found) {
return foundItem;
}
return null;
},
addMenuItem : function(obj) {
addMenuItem: function (obj) {
Backend.Menu.selectors.menuItemContainer.nestable('add', {
"id": Backend.Menu.methods.getNewId(Backend.Menu.selectors.menuItemsData.val()),
"content": obj.name,
"name": obj.name,
"url": obj.url,
"url_type" : obj.url_type,
"url_type": obj.url_type,
"open_in_new_tab": obj.open_in_new_tab,
"icon": obj.icon,
"view_permission_id": obj.view_permission_id
......@@ -452,7 +448,7 @@ var Backend = {}; // common variable used in all the files of the backend
);
},
editMenuItem : function(obj) {
editMenuItem: function (obj) {
var newObject = {
"id": obj.id,
"content": obj.name,
......@@ -465,11 +461,13 @@ var Backend = {}; // common variable used in all the files of the backend
};
var menuItems = Backend.Menu.selectors.menuItemContainer.nestable('serialise');
var itemData;
$.each(menuItems, function(index, item){
$.each(menuItems, function (index, item) {
itemData = Backend.Menu.methods.findItemById(item, id);
if(itemData) { return false; }
if (itemData) {
return false;
}
});
if(itemData.children) {
if (itemData.children) {
newObject.children = itemData.children;
}
......@@ -492,16 +490,16 @@ var Backend = {}; // common variable used in all the files of the backend
var formName = "_add_custom_url_form";
this.selectors.menuItemContainer.nestable({
callback: function(l, e){
callback: function (l, e) {
this.selectors.menuItemsData.val(JSON.stringify($(l).nestable('serialise')));
},
json: this.selectors.menuItemsData.val(),
includeContent:true,
includeContent: true,
scroll: false,
maxDepth: 10
});
this.selectors.addCustomUrlButton.click(function() {
this.selectors.addCustomUrlButton.click(function () {
var title = context.selectors.addCustomUrlButton.attr("data-header");
context.selectors.modal.find(".modal-title").html(title);
context.selectors.modal.modal("show");
......@@ -518,18 +516,18 @@ var Backend = {}; // common variable used in all the files of the backend
error: function (request) {
//Do Something
}
}
};
Backend.Utils.ajaxrequest(context.selectors.formUrl + "/" + formName, "get", {}, Backend.Utils.csrf, callback);
});
jQuery(document).on("submit", context.selectors.addCustomUrlForm, function(e){
jQuery(document).on("submit", context.selectors.addCustomUrlForm, function (e) {
e.preventDefault();
var formData = jQuery(this).serializeArray().reduce(function(obj, item) {
var formData = jQuery(this).serializeArray().reduce(function (obj, item) {
obj[item.name] = item.value;
return obj;
}, {});
if(formData.name.length > 0) {
if(formData.id.length > 0) {
if (formData.name.length > 0) {
if (formData.id.length > 0) {
context.methods.editMenuItem(formData);
} else {
context.methods.addMenuItem(formData);
......@@ -538,7 +536,7 @@ var Backend = {}; // common variable used in all the files of the backend
}
});
jQuery(document).on("click", context.selectors.addModuleToMenuButton, function(){
jQuery(document).on("click", context.selectors.addModuleToMenuButton, function () {
var dataObj = {
id: $(this).attr("data-id"),
name: $(this).attr("data-name"),
......@@ -546,11 +544,11 @@ var Backend = {}; // common variable used in all the files of the backend
url_type: $(this).attr("data-url_type"),
open_in_new_tab: $(this).attr("data-open_in_new_tab"),
view_permission_id: $(this).attr("data-view_permission_id"),
}
};
context.methods.addMenuItem(dataObj);
});
jQuery(document).on("click", context.selectors.removeMenuItemButton, function() {
jQuery(document).on("click", context.selectors.removeMenuItemButton, function () {
context.selectors.menuItemContainer.nestable('remove', jQuery(this).parents(".dd-item").first().attr("data-id"));
Backend.Menu.selectors.menuItemsData.val(
JSON.stringify(
......@@ -559,16 +557,17 @@ var Backend = {}; // common variable used in all the files of the backend
);
});
jQuery(document).on("click", context.selectors.editMenuItemButton, function() {
jQuery(document).on("click", context.selectors.editMenuItemButton, function () {
id = jQuery(this).parents(".dd-item").first().attr("data-id");
var menuItems = context.selectors.menuItemContainer.nestable('serialise');
var itemData;
$.each(menuItems, function(index, item){
$.each(menuItems, function (index, item) {
itemData = context.methods.findItemById(item, id);
if(itemData) { return false; }
if (itemData) {
return false;
}
});
if(itemData.id != undefined && itemData.id == id)
{
if (itemData.id != undefined && itemData.id == id) {
callback = {
success: function (request) {
if (request.status >= 200 && request.status < 400) {
......@@ -578,8 +577,8 @@ var Backend = {}; // common variable used in all the files of the backend
$(document).find(context.selectors.modal).find(".mi-id").val(itemData.id);
$(document).find(context.selectors.modal).find(".mi-name").val(itemData.name);
$(document).find(context.selectors.modal).find(".mi-url").val(itemData.url);
$(document).find(context.selectors.modal).find(".mi-url_type_"+itemData.url_type).prop("checked", true);
if(itemData.open_in_new_tab == 1) {
$(document).find(context.selectors.modal).find(".mi-url_type_" + itemData.url_type).prop("checked", true);
if (itemData.open_in_new_tab == 1) {
$(document).find(context.selectors.modal).find(".mi-open_in_new_tab").prop("checked", true);
}
$(document).find(context.selectors.modal).find(".mi-icon").val(itemData.icon);
......@@ -591,7 +590,7 @@ var Backend = {}; // common variable used in all the files of the backend
error: function (request) {
//Do Something
}
}
};
Backend.Utils.ajaxrequest(context.selectors.formUrl + "/" + formName, "get", {}, Backend.Utils.csrf, callback);
}
});
......@@ -601,8 +600,7 @@ var Backend = {}; // common variable used in all the files of the backend
/**
* Tiny MCE
*/
tinyMCE:
{
tinyMCE: {
init: function () {
tinymce.init({
path_absolute: "/",
......@@ -648,8 +646,7 @@ var Backend = {}; // common variable used in all the files of the backend
}
},
emailTemplate:
{
emailTemplate: {
selectors: {
emailtemplateSelection: document.querySelector(".select2")
......@@ -694,27 +691,22 @@ var Backend = {}; // common variable used in all the files of the backend
* Faq
*
*/
Faq:
{
selectors:
{
},
Faq: {
selectors: {},
init: function () {
// this.addHandlers();
Backend.tinyMCE.init();
},
addHandlers: function () {
}
addHandlers: function () {}
},
/**
* Profile
*
*/
Profile:
{
Profile: {
selectors: {
},
......@@ -741,10 +733,8 @@ var Backend = {}; // common variable used in all the files of the backend
* for all datatables
*
*/
DataTableSearch:
{ //functionalities related to datable search at all the places
selector: {
},
DataTableSearch: { //functionalities related to datable search at all the places
selector: {},
init: function (dataTable) {
......@@ -758,7 +748,7 @@ var Backend = {}; // common variable used in all the files of the backend
setSelectors: function () {
this.selector.searchInput = document.querySelector("div.dataTables_filter input");
this.selector.columnSearchInput = document.querySelectorAll(".search-input-text");
this.selector.columnSelectInput = document.querySelectorAll('search-input-select');
this.selector.columnSelectInput = document.querySelectorAll(".search-input-select");
this.selector.restButton = document.querySelectorAll('.reset-data');
this.setSelectors.copyButton = document.getElementById("copyButton");
this.setSelectors.csvButton = document.getElementById("csvButton");
......@@ -793,7 +783,7 @@ var Backend = {}; // common variable used in all the files of the backend
this.selector.columnSearchInput.forEach(function (element) {
element.onkeypress = function (event) {
if (event.keyCode == 13) {
var i = element.getAttribute("data-column") // getting column index
var i = element.getAttribute("data-column"); // getting column index
var v = element.value; // getting search input value
dataTable.api().columns(i).search(v).draw();
}
......@@ -848,8 +838,7 @@ var Backend = {}; // common variable used in all the files of the backend
* Settings
*
*/
Settings:
{
Settings: {
selectors: {
RouteURL: "",
setting: document.getElementById("setting")
......@@ -884,8 +873,7 @@ var Backend = {}; // common variable used in all the files of the backend
if (data == 'logo') {
value = 'logo';
Backend.Utils.addClass(Backend.Settings.selectors.imageRemoveLogo, 'hidden');
}
else {
} else {
value = 'favicon';
Backend.Utils.addClass(Backend.Settings.selectors.imageRemoveFavicon, 'hidden');
}
......@@ -901,7 +889,10 @@ var Backend = {}; // common variable used in all the files of the backend
}
};
Backend.Utils.ajaxrequest(route, "POST", { data: value, _token: Backend.Utils.csrf }, Backend.Utils.csrf, callback);
Backend.Utils.ajaxrequest(route, "POST", {
data: value,
_token: Backend.Utils.csrf
}, Backend.Utils.csrf, callback);
}
});
};
......@@ -910,12 +901,3 @@ var Backend = {}; // common variable used in all the files of the backend
};
})();
\ No newline at end of file
......@@ -150,7 +150,7 @@ $.AdminLTE.options = {
* functions and plugins as specified by the
* options above.
*/
$(function () {
$(function() {
//Extend options if external options exist
if (typeof AdminLTEOptions !== 'undefined') {
$.extend(true,
......@@ -208,7 +208,7 @@ $(function () {
//Activate direct chat widget
if (o.directChat.enable) {
$(o.directChat.contactToggleSelector).on('click', function () {
$(o.directChat.contactToggleSelector).on('click', function() {
var box = $(this).parents('.direct-chat').first();
box.toggleClass('direct-chat-contacts-open');
});
......@@ -218,9 +218,9 @@ $(function () {
* INITIALIZE BUTTON TOGGLE
* ------------------------
*/
$('.btn-group[data-toggle="btn-toggle"]').each(function () {
$('.btn-group[data-toggle="btn-toggle"]').each(function() {
var group = $(this);
$(this).find('.btn').on('click', function (e) {
$(this).find('.btn').on('click', function(e) {
group.find('.btn.active').removeClass('active');
$(this).addClass('active');
e.preventDefault();
......@@ -246,16 +246,16 @@ function _init() {
* $.AdminLTE.layout.fixSidebar()
*/
$.AdminLTE.layout = {
activate: function () {
activate: function() {
var _this = this;
_this.fix();
_this.fixSidebar();
$(window, '.wrapper').resize(function () {
$(window, '.wrapper').resize(function() {
_this.fix();
_this.fixSidebar();
});
},
fix: function () {
fix: function() {
//Get window height and the wrapper height
var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight();
var windowHeight = $(window).height();
......@@ -284,11 +284,13 @@ function _init() {
}
},
fixSidebar: function () {
fixSidebar: function() {
//Make sure the body tag has the .fixed class
if (!$('body').hasClass('fixed')) {
if (typeof $.fn.slimScroll !== 'undefined') {
$('.sidebar').slimScroll({destroy: true}).height('auto');
$('.sidebar').slimScroll({
destroy: true
}).height('auto');
}
return;
} else if (typeof $.fn.slimScroll === 'undefined' && console) {
......@@ -298,7 +300,9 @@ function _init() {
if ($.AdminLTE.options.sidebarSlimScroll) {
if (typeof $.fn.slimScroll !== 'undefined') {
//Destroy if it exists
$('.sidebar').slimScroll({destroy: true}).height('auto');
$('.sidebar').slimScroll({
destroy: true
}).height('auto');
//Add slimscroll
$('.sidebar').slimscroll({
height: ($(window).height() - $('.main-header').height()) + 'px',
......@@ -318,12 +322,12 @@ function _init() {
* @usage: $.AdminLTE.pushMenu("[data-toggle='offcanvas']")
*/
$.AdminLTE.pushMenu = {
activate: function (toggleBtn) {
activate: function(toggleBtn) {
//Get the screen sizes
var screenSizes = $.AdminLTE.options.screenSizes;
//Enable sidebar toggle
$(toggleBtn).on('click', function (e) {
$(toggleBtn).on('click', function(e) {
e.preventDefault();
//Enable sidebar push menu
......@@ -341,7 +345,7 @@ function _init() {
}
});
$('.content-wrapper').click(function () {
$('.content-wrapper').click(function() {
//Enable hide menu when clicking on the content-wrapper on small screens
if ($(window).width() <= (screenSizes.sm - 1) && $('body').hasClass('sidebar-open')) {
$('body').removeClass('sidebar-open');
......@@ -355,17 +359,17 @@ function _init() {
}
},
expandOnHover: function () {
expandOnHover: function() {
var _this = this;
var screenWidth = $.AdminLTE.options.screenSizes.sm - 1;
//Expand sidebar on hover
$('.main-sidebar').hover(function () {
$('.main-sidebar').hover(function() {
if ($('body').hasClass('sidebar-mini') &&
$('body').hasClass('sidebar-collapse') &&
$(window).width() > screenWidth) {
_this.expand();
}
}, function () {
}, function() {
if ($('body').hasClass('sidebar-mini') &&
$('body').hasClass('sidebar-expanded-on-hover') &&
$(window).width() > screenWidth) {
......@@ -373,10 +377,10 @@ function _init() {
}
});
},
expand: function () {
expand: function() {
$('body').removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover');
},
collapse: function () {
collapse: function() {
if ($('body').hasClass('sidebar-expanded-on-hover')) {
$('body').removeClass('sidebar-expanded-on-hover').addClass('sidebar-collapse');
}
......@@ -391,10 +395,10 @@ function _init() {
* @type Function
* @Usage: $.AdminLTE.tree('.sidebar')
*/
$.AdminLTE.tree = function (menu) {
$.AdminLTE.tree = function(menu) {
var _this = this;
var animationSpeed = $.AdminLTE.options.animationSpeed;
$('li a', $(menu)).on('click', function (e) {
$('li a', $(menu)).on('click', function(e) {
//Get the clicked link and the next element
var $this = $(this);
var checkElement = $this.next();
......@@ -402,7 +406,7 @@ function _init() {
//Check if the next element is a menu and is visible
if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible'))) {
//Close the menu
checkElement.slideUp(animationSpeed, function () {
checkElement.slideUp(animationSpeed, function() {
checkElement.removeClass('menu-open');
//Fix the layout in case the sidebar stretches over the height of the window
//_this.layout.fix();
......@@ -421,7 +425,7 @@ function _init() {
var liParent = $this.parent('li');
//Open the target menu and add the menu-open class
checkElement.slideDown(animationSpeed, function () {
checkElement.slideDown(animationSpeed, function() {
//Add the class active to the parent li
checkElement.addClass('menu-open');
parent.find('li.active').removeClass('active');
......@@ -446,7 +450,7 @@ function _init() {
*/
$.AdminLTE.controlSidebar = {
//instantiate the object
activate: function () {
activate: function() {
//Get the object
var _this = this;
//Update options
......@@ -457,7 +461,7 @@ function _init() {
var btn = $(o.toggleBtnSelector);
//Listen to the click event
btn.on('click', function (e) {
btn.on('click', function(e) {
e.preventDefault();
//If the sidebar is not open
if (!sidebar.hasClass('control-sidebar-open') && !$('body').hasClass('control-sidebar-open')) {
......@@ -483,7 +487,7 @@ function _init() {
}
},
//Open the control sidebar
open: function (sidebar, slide) {
open: function(sidebar, slide) {
// var _this = this;
//Slide over content
if (slide) {
......@@ -495,19 +499,19 @@ function _init() {
}
},
//Close the control sidebar
close: function (sidebar, slide) {
close: function(sidebar, slide) {
if (slide) {
sidebar.removeClass('control-sidebar-open');
} else {
$('body').removeClass('control-sidebar-open');
}
},
_fix: function (sidebar) {
_fix: function(sidebar) {
var _this = this;
if ($('body').hasClass('layout-boxed')) {
sidebar.css('position', 'absolute');
sidebar.height($('.wrapper').height());
$(window).resize(function () {
$(window).resize(function() {
_this._fix(sidebar);
});
} else {
......@@ -517,7 +521,7 @@ function _init() {
});
}
},
_fixForFixed: function (sidebar) {
_fixForFixed: function(sidebar) {
sidebar.css({
'position': 'fixed',
'max-height': '100%',
......@@ -525,7 +529,7 @@ function _init() {
'padding-bottom': '50px'
});
},
_fixForContent: function (sidebar) {
_fixForContent: function(sidebar) {
$('.content-wrapper, .right-side').css('min-height', sidebar.height());
}
};
......@@ -543,24 +547,24 @@ function _init() {
selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors,
icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons,
animationSpeed: $.AdminLTE.options.animationSpeed,
activate: function (_box) {
activate: function(_box) {
var _this = this;
if (! _box) {
if (!_box) {
_box = document; // activate all boxes per default
}
//Listen for collapse event triggers
$(_box).find(_this.selectors.collapse).on('click', function (e) {
$(_box).find(_this.selectors.collapse).on('click', function(e) {
e.preventDefault();
_this.collapse($(this));
});
//Listen for remove event triggers
$(_box).find(_this.selectors.remove).on('click', function (e) {
$(_box).find(_this.selectors.remove).on('click', function(e) {
e.preventDefault();
_this.remove($(this));
});
},
collapse: function (element) {
collapse: function(element) {
var _this = this;
//Find the box parent
var box = element.parents('.box').first();
......@@ -572,7 +576,7 @@ function _init() {
.removeClass(_this.icons.collapse)
.addClass(_this.icons.open);
//Hide the content
boxContent.slideUp(_this.animationSpeed, function () {
boxContent.slideUp(_this.animationSpeed, function() {
box.addClass('collapsed-box');
});
} else {
......@@ -581,12 +585,12 @@ function _init() {
.removeClass(_this.icons.open)
.addClass(_this.icons.collapse);
//Show the content
boxContent.slideDown(_this.animationSpeed, function () {
boxContent.slideDown(_this.animationSpeed, function() {
box.removeClass('collapsed-box');
});
}
},
remove: function (element) {
remove: function(element) {
//Find the box parent
var box = element.parents('.box').first();
box.slideUp(this.animationSpeed);
......@@ -609,9 +613,9 @@ function _init() {
* @type plugin
* @usage $('#box-widget').boxRefresh( options );
*/
(function ($) {
(function($) {
$.fn.boxRefresh = function (options) {
$.fn.boxRefresh = function(options) {
// Render options
var settings = $.extend({
......@@ -620,17 +624,15 @@ function _init() {
//File source to be loaded (e.g: ajax/src.php)
source: '',
//Callbacks
onLoadStart: function (box) {
}, //Right after the button has been clicked
onLoadDone: function (box) {
} //When the source has been loaded
onLoadStart: function(box) {}, //Right after the button has been clicked
onLoadDone: function(box) {} //When the source has been loaded
}, options);
//The overlay
var overlay = $('<div class="overlay"><div class="fa fa-refresh fa-spin"></div></div>');
return this.each(function () {
return this.each(function() {
//if a source is specified
if (settings.source === '') {
if (console) {
......@@ -644,13 +646,13 @@ function _init() {
var rBtn = box.find(settings.trigger).first();
//On trigger click
rBtn.on('click', function (e) {
rBtn.on('click', function(e) {
e.preventDefault();
//Add loading overlay
start(box);
//Perform ajax call
box.find('.box-body').load(settings.source, function () {
box.find('.box-body').load(settings.source, function() {
done(box);
});
});
......@@ -683,9 +685,9 @@ function _init() {
* @type plugin
* @usage $('#box-widget').activateBox();
*/
(function ($) {
(function($) {
$.fn.activateBox = function () {
$.fn.activateBox = function() {
$.AdminLTE.boxWidget.activate(this);
};
......@@ -699,35 +701,33 @@ function _init() {
* @type plugin
* @usage $('#todo-widget').todolist( options );
*/
(function ($) {
(function($) {
$.fn.todolist = function (options) {
$.fn.todolist = function(options) {
// Render options
var settings = $.extend({
//When the user checks the input
onCheck: function (ele) {
},
onCheck: function(ele) {},
//When the user unchecks the input
onUncheck: function (ele) {
}
onUncheck: function(ele) {}
}, options);
return this.each(function () {
return this.each(function() {
if (typeof $.fn.iCheck !== 'undefined') {
$('input', this).on('ifChecked', function (event) {
$('input', this).on('ifChecked', function(event) {
var ele = $(this).parents('li').first();
ele.toggleClass('done');
settings.onCheck.call(ele);
});
$('input', this).on('ifUnchecked', function (event) {
$('input', this).on('ifUnchecked', function(event) {
var ele = $(this).parents('li').first();
ele.toggleClass('done');
settings.onUncheck.call(ele);
});
} else {
$('input', this).on('change', function (event) {
$('input', this).on('change', function(event) {
var ele = $(this).parents('li').first();
ele.toggleClass('done');
settings.onCheck.call(ele);
......@@ -744,6 +744,7 @@ function _init() {
*/
Vue.component('flash', require('../components/backend/Flash.vue'));
Vue.component('export-component', require('../components/backend/Export.vue'));
const app = new Vue({
el: '#app'
......
<template>
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li id="copyButton"><a href="#"><i class="fa fa-clone"></i> Copy</a></li>
<li id="csvButton"><a href="#"><i class="fa fa-file-text-o"></i> CSV</a></li>
<li id="excelButton"><a href="#"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<li id="pdfButton"><a href="#"><i class="fa fa-file-pdf-o"></i> PDF</a></li>
<li id="printButton"><a href="#"><i class="fa fa-print"></i> Print</a></li>
</ul>
</div>
</template>
<script>
export default {
props: [],
data() {
return {};
}
};
</script>
......@@ -5,24 +5,24 @@
</template>
<script>
export default {
props: ['message' , 'type'],
export default {
props: ["message", "type"],
data() {
return {
body: '',
typeClass: '',
body: "",
typeClass: "",
show: false
}
};
},
created() {
var context = this;
if(this.message && this.type) {
if (this.message && this.type) {
this.flash(this.message, this.type);
}
window.events.$on('flash', function(message, type) {
window.events.$on("flash", function(message, type) {
context.flash(message, type);
});
},
......@@ -42,5 +42,5 @@
}, 3000);
}
}
}
};
</script>
<!--Action Button-->
@if(Active::checkUriPattern('admin/access/permission'))
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li id="copyButton"><a href="#"><i class="fa fa-clone"></i> Copy</a></li>
<li id="csvButton"><a href="#"><i class="fa fa-file-text-o"></i> CSV</a></li>
<li id="excelButton"><a href="#"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<li id="pdfButton"><a href="#"><i class="fa fa-file-pdf-o"></i> PDF</a></li>
<li id="printButton"><a href="#"><i class="fa fa-print"></i> Print</a></li>
</ul>
</div>
<export-component></export-component>
@endif
<!--Action Button-->
<div class="btn-group">
......
<!--Action Button-->
@if(Active::checkUriPattern('admin/blogCategories'))
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li id="copyButton"><a href="#"><i class="fa fa-clone"></i> Copy</a></li>
<li id="csvButton"><a href="#"><i class="fa fa-file-text-o"></i> CSV</a></li>
<li id="excelButton"><a href="#"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<li id="pdfButton"><a href="#"><i class="fa fa-file-pdf-o"></i> PDF</a></li>
<li id="printButton"><a href="#"><i class="fa fa-print"></i> Print</a></li>
</ul>
</div>
<export-component></export-component>
@endif
<!--Action Button-->
<div class="btn-group">
......
<!--Action Button-->
@if(Active::checkUriPattern('admin/blogs'))
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li id="copyButton"><a href="#"><i class="fa fa-clone"></i> Copy</a></li>
<li id="csvButton"><a href="#"><i class="fa fa-file-text-o"></i> CSV</a></li>
<li id="excelButton"><a href="#"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<li id="pdfButton"><a href="#"><i class="fa fa-file-pdf-o"></i> PDF</a></li>
<li id="printButton"><a href="#"><i class="fa fa-print"></i> Print</a></li>
</ul>
</div>
<export-component></export-component>
@endif
<!--Action Button-->
<div class="btn-group">
......
<!--Action Button-->
@if(Active::checkUriPattern('admin/blogTags'))
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li id="copyButton"><a href="#"><i class="fa fa-clone"></i> Copy</a></li>
<li id="csvButton"><a href="#"><i class="fa fa-file-text-o"></i> CSV</a></li>
<li id="excelButton"><a href="#"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<li id="pdfButton"><a href="#"><i class="fa fa-file-pdf-o"></i> PDF</a></li>
<li id="printButton"><a href="#"><i class="fa fa-print"></i> Print</a></li>
</ul>
</div>
<export-component></export-component>
@endif
<!--Action Button-->
<div class="btn-group">
......
......@@ -12,7 +12,7 @@
<h3 class="box-title">{{ trans('labels.backend.faqs.management') }}</h3>
<div class="box-tools pull-right">
@include('backend.includes.partials.faqs-header-buttons')
@include('backend.faqs.partials.faqs-header-buttons')
</div>
</div><!-- /.box-header -->
......
<!--Action Button-->
@if(Active::checkUriPattern('admin/faqs'))
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li id="copyButton"><a href="#"><i class="fa fa-clone"></i> Copy</a></li>
<li id="csvButton"><a href="#"><i class="fa fa-file-text-o"></i> CSV</a></li>
<li id="excelButton"><a href="#"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<li id="pdfButton"><a href="#"><i class="fa fa-file-pdf-o"></i> PDF</a></li>
<li id="printButton"><a href="#"><i class="fa fa-print"></i> Print</a></li>
</ul>
</div>
@endif
@if(Active::checkUriPattern('admin/faqs'))
<export-component></export-component>
@endif
<!--Action Button-->
<div class="btn-group">
<button type="button" class="btn btn-primary btn-flat dropdown-toggle" data-toggle="dropdown">Action
......
<!--Action Button-->
@if(Active::checkUriPattern('admin/menus'))
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li id="copyButton"><a href="#"><i class="fa fa-clone"></i> Copy</a></li>
<li id="csvButton"><a href="#"><i class="fa fa-file-text-o"></i> CSV</a></li>
<li id="excelButton"><a href="#"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<li id="pdfButton"><a href="#"><i class="fa fa-file-pdf-o"></i> PDF</a></li>
<li id="printButton"><a href="#"><i class="fa fa-print"></i> Print</a></li>
</ul>
</div>
@endif
@if(Active::checkUriPattern('admin/menus'))
<export-component></export-component>
@endif
<!--Action Button-->
<div class="btn-group">
<button type="button" class="btn btn-primary btn-flat dropdown-toggle" data-toggle="dropdown">Action
......
<!--Action Button-->
@if(Active::checkUriPattern('admin/pages'))
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li id="copyButton"><a href="#"><i class="fa fa-clone"></i> Copy</a></li>
<li id="csvButton"><a href="#"><i class="fa fa-file-text-o"></i> CSV</a></li>
<li id="excelButton"><a href="#"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<li id="pdfButton"><a href="#"><i class="fa fa-file-pdf-o"></i> PDF</a></li>
<li id="printButton"><a href="#"><i class="fa fa-print"></i> Print</a></li>
</ul>
</div>
@endif
@if(Active::checkUriPattern('admin/pages'))
<export-component></export-component>
@endif
<!--Action Button-->
<div class="btn-group">
<button type="button" class="btn btn-primary btn-flat dropdown-toggle" data-toggle="dropdown">Action
......
......@@ -16,7 +16,6 @@ class ManageBlogCategoriesTest extends TestCase
->assertSee(trans('labels.backend.blogcategories.management'))
->assertSee(trans('labels.backend.blogcategories.table.title'))
->assertSee(trans('labels.backend.blogcategories.table.status'))
->assertSee('Export')
->assertSee('Action');
}
......
......@@ -16,7 +16,6 @@ class ManageBlogTagsTest extends TestCase
->assertSee(trans('labels.backend.blogtags.management'))
->assertSee(trans('labels.backend.blogtags.table.title'))
->assertSee(trans('labels.backend.blogtags.table.status'))
->assertSee('Export')
->assertSee('Action');
}
......
......@@ -39,7 +39,6 @@ class ManageBlogsTest extends TestCase
->assertSee(trans('labels.backend.blogs.table.createdby'))
->assertSee(trans('labels.backend.blogs.table.createdat'))
->assertSee(trans('labels.backend.blogs.table.status'))
->assertSee('Export')
->assertSee('Action');
}
......
......@@ -17,7 +17,6 @@ class ManageFaqsTest extends TestCase
->assertSee(trans('labels.backend.faqs.table.question'))
->assertSee(trans('labels.backend.faqs.table.answer'))
->assertSee(trans('labels.backend.faqs.table.status'))
->assertSee('Export')
->assertSee('Action');
}
......
......@@ -18,7 +18,6 @@ class ManagePermissionsTest extends TestCase
->get(route('admin.access.permission.index'))
->assertViewIs('backend.access.permissions.index')
->assertSee(trans('labels.backend.access.permissions.management'))
->assertSee('Export')
->assertSee('Action');
}
......
......@@ -20,7 +20,6 @@ class ManageRolesTest extends TestCase
->get(route('admin.access.role.index'))
->assertViewIs('backend.access.roles.index')
->assertSee(trans('labels.backend.access.roles.management'))
->assertSee('Export')
->assertSee('Action');
}
......
......@@ -44,7 +44,6 @@ class ManageUsersTest extends TestCase
->assertViewIs('backend.access.users.index')
->assertSee(trans('labels.backend.access.users.management'))
->assertSee(trans('labels.backend.access.users.active'))
->assertSee('Export')
->assertSee('Action');
}
......@@ -56,7 +55,6 @@ class ManageUsersTest extends TestCase
->assertViewIs('backend.access.users.deactivated')
->assertSee(trans('labels.backend.access.users.management'))
->assertSee(trans('labels.backend.access.users.deactivated'))
->assertSee('Export')
->assertSee('Action');
}
......@@ -68,7 +66,6 @@ class ManageUsersTest extends TestCase
->assertViewIs('backend.access.users.deleted')
->assertSee(trans('labels.backend.access.users.management'))
->assertSee(trans('labels.backend.access.users.deleted'))
->assertSee('Export')
->assertSee('Action');
}
......
......@@ -24,12 +24,6 @@ class LoggedOutRouteTest extends BrowserKitTestCase
$this->visit('/')->assertResponseOk();
}
/** @test */
public function test_macroPage()
{
$this->visit('/macros')->see('Macro Examples');
}
/** @test */
public function testLoginPage()
{
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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