Apply fixes from StyleCI
This commit is contained in:

committed by
RafficMohammed

parent
0975cc5dd9
commit
b3b057e0cc
@@ -3,7 +3,7 @@
|
||||
use App\Http\Controllers\Common;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
/*
|
||||
* ================================================================================================
|
||||
* @version v1
|
||||
* @access public
|
||||
@@ -11,7 +11,7 @@ use Illuminate\Support\Facades\Route;
|
||||
* @author Vijay Sebastian<vijay.sebastian@ladybirdweb.com>
|
||||
* @name Faveo
|
||||
*/
|
||||
Route::prefix('api/v1')->group(function () {
|
||||
Route::prefix('api/v1')->group(function () {
|
||||
Route::post('authenticate', [\App\Api\v1\TokenAuthController::class, 'authenticate']);
|
||||
Route::get('authenticate/user', [\App\Api\v1\TokenAuthController::class, 'getAuthenticatedUser']);
|
||||
Route::get('/database-config', [\App\Api\v1\InstallerApiController::class, 'config_database'])->name('database-config');
|
||||
@@ -64,8 +64,8 @@ use Illuminate\Support\Facades\Route;
|
||||
* FCM token response
|
||||
*/
|
||||
Route::post('fcmtoken', [Common\PushNotificationController::class, 'fcmToken'])->name('fcmtoken');
|
||||
});
|
||||
/*
|
||||
});
|
||||
/*
|
||||
* ================================================================================================
|
||||
* @version v1
|
||||
* @access public
|
||||
@@ -73,11 +73,11 @@ use Illuminate\Support\Facades\Route;
|
||||
* @author Manish Verma<manish.verma@ladybirdweb.com>
|
||||
* @name Faveo
|
||||
*/
|
||||
Route::prefix('api/v2')->group(function () {
|
||||
Route::prefix('api/v2')->group(function () {
|
||||
/*
|
||||
* Helpdesk
|
||||
*/
|
||||
Route::prefix('helpdesk')->group(function () {
|
||||
Route::get('tickets', [\App\Api\v2\TicketController::class, 'getTickets']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -32,6 +32,7 @@ use Illuminate\Support\Str;
|
||||
*
|
||||
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
||||
* @copyright (c) 2016, Ladybird Web Solution
|
||||
*
|
||||
* @name Faveo HELPDESK
|
||||
*
|
||||
* @version v1
|
||||
|
@@ -26,6 +26,7 @@ use Mail;
|
||||
*
|
||||
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
||||
* @copyright (c) 2016, Ladybird Web Solution
|
||||
*
|
||||
* @name Faveo HELPDESK
|
||||
*
|
||||
* @version v1
|
||||
|
@@ -19,6 +19,7 @@ use Tymon\JWTAuth\Exceptions\JWTException;
|
||||
*
|
||||
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
||||
* @copyright (c) 2016, Ladybird Web Solution
|
||||
*
|
||||
* @name Faveo HELPDESK
|
||||
*
|
||||
* @version v1
|
||||
|
@@ -70,7 +70,7 @@ class SecureFaveoAPPKey extends Command
|
||||
}
|
||||
$this->line("\r\nAPP_KEY has been updated in the environment.");
|
||||
$this->line("\r\nNext you might want to check if your configured email is working fine or not. If it has any problem you can update the password and restart your queue workers if you are processing mail jobs in queue.\r\n");
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
$this->info('Alright, calm down we did not make any changes to your environment. But if you think your APP_KEY was compromised or you were using Faveo without generating APP_KEY explicitly(for version v1.10.* or older) we recommend you to run this command on priority basis.');
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ class Sync extends Command
|
||||
public function handle()
|
||||
{
|
||||
(new SyncFaveoToLatestVersion())->sync();
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ class Kernel extends ConsoleKernel
|
||||
\App\Console\Commands\InstallDB::class,
|
||||
\App\Console\Commands\SetupTestEnv::class,
|
||||
\App\Console\Commands\SecureFaveoAPPKey::class,
|
||||
SyncFaveoToLatestVersion::class
|
||||
SyncFaveoToLatestVersion::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
@@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Session\TokenMismatchException;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
||||
|
@@ -3,7 +3,6 @@
|
||||
namespace App\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromArray;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
|
||||
class UserExport implements FromArray, WithHeadings
|
||||
|
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\App;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Breadcrumbs::register('logs', function ($breadcrumbs) {
|
||||
|
@@ -149,15 +149,12 @@ class LanguageController extends Controller
|
||||
// doing the validation, passing post data, rules and the messages
|
||||
$validator = Validator::make($file, $rules);
|
||||
if ($validator->fails()) {
|
||||
|
||||
// send back to the page with the input data and errors
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
} else {
|
||||
|
||||
//Checking if package already exists or not in lang folder
|
||||
$path = base_path('lang');
|
||||
if (in_array(strtolower(Request::get('iso-code')), scandir($path))) {
|
||||
|
||||
//sending back with error message
|
||||
Session::flash('fails', Lang::get('lang.package_exist'));
|
||||
Session::flash('link', 'change-language/'.strtolower(Request::get('iso-code')));
|
||||
@@ -169,7 +166,6 @@ class LanguageController extends Controller
|
||||
|
||||
return Redirect::back()->withInput();
|
||||
} else {
|
||||
|
||||
// checking file is valid.
|
||||
if (Request::file('File')->isValid()) {
|
||||
$name = Request::file('File')->getClientOriginalName(); //uploaded file's original name
|
||||
|
@@ -159,7 +159,7 @@ class PriorityController extends Controller
|
||||
->update(['is_default' => 1]);
|
||||
}
|
||||
|
||||
return \Redirect::route('priority.index')->with('success', (Lang::get('lang.priority_successfully_updated')));
|
||||
return \Redirect::route('priority.index')->with('success', Lang::get('lang.priority_successfully_updated'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,6 +187,6 @@ class PriorityController extends Controller
|
||||
|
||||
$tk_priority->delete();
|
||||
|
||||
return \Redirect::route('priority.index')->with('success', (Lang::get('lang.delete_successfully')));
|
||||
return \Redirect::route('priority.index')->with('success', Lang::get('lang.delete_successfully'));
|
||||
}
|
||||
}
|
||||
|
@@ -952,6 +952,7 @@ class FilterController extends Controller
|
||||
* @category function to filter tickets by SLA
|
||||
*
|
||||
* @param string array $value, builder $table
|
||||
*
|
||||
* @
|
||||
*
|
||||
* @return builder
|
||||
|
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers\Agent\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Agent\helpdesk\Filter\FilterControllerOld;
|
||||
use App\Http\Controllers\Common\FileuploadController;
|
||||
use App\Http\Controllers\Common\NotificationController as Notify;
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
@@ -51,7 +50,6 @@ use Illuminate\Support\Str;
|
||||
use Lang;
|
||||
use Mail;
|
||||
use UTC;
|
||||
use Vsmoraes\Pdf\Pdf;
|
||||
use Vsmoraes\Pdf\PdfFacade;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
|
@@ -640,7 +640,6 @@ class UserController extends Controller
|
||||
public function edit($id, CountryCode $code)
|
||||
{
|
||||
try {
|
||||
|
||||
// dd('here');
|
||||
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
|
||||
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
|
||||
@@ -996,6 +995,7 @@ class UserController extends Controller
|
||||
$users = $this->getUsers($first_date, $second_date);
|
||||
$excel_controller = new \App\Http\Controllers\Common\ExcelController();
|
||||
$filename = 'users'.$date;
|
||||
|
||||
return $excel_controller->export($filename, $users);
|
||||
} catch (Exception $ex) {
|
||||
return redirect()->back()->with('fails', $ex->getMessage());
|
||||
@@ -1046,7 +1046,7 @@ class UserController extends Controller
|
||||
->first();
|
||||
if ($otp != null) {
|
||||
$otp_length = strlen(Input::get('otp'));
|
||||
if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) {
|
||||
if ($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp'))) {
|
||||
$otp2 = Hash::make(Input::get('otp'));
|
||||
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
||||
$date2 = date('Y-m-d h:i:sa');
|
||||
|
@@ -184,7 +184,6 @@ class CategoryController extends Controller
|
||||
*/
|
||||
public function update($id, CategoryRequest $request)
|
||||
{
|
||||
|
||||
/* Edit the selected category via id */
|
||||
$category = Category::where('id', $id)->first();
|
||||
$sl = $request->input('name');
|
||||
|
@@ -550,7 +550,7 @@ class AuthController extends Controller
|
||||
$otp = Otp::select('otp', 'updated_at')->where('user_id', '=', $user->id)
|
||||
->first();
|
||||
if ($otp != null) {
|
||||
if (($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp')))) {
|
||||
if ($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp'))) {
|
||||
$otp2 = Hash::make($request->input('otp'));
|
||||
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
||||
$date2 = date('Y-m-d h:i:sa');
|
||||
|
@@ -188,7 +188,7 @@ class FormController extends Controller
|
||||
// $priority = $ticket_settings->first()->priority;
|
||||
$default_priority = Ticket_Priority::where('is_default', '=', 1)->first();
|
||||
$user_priority = CommonSettings::where('option_name', '=', 'user_priority')->first();
|
||||
if (!($request->input('priority'))) {
|
||||
if (!$request->input('priority')) {
|
||||
$priority = $default_priority->priority_id;
|
||||
if ($helpTopicObj->exists() && ($helpTopicObj->value('status') == 1)) {
|
||||
$priority = $helpTopicObj->value('priority');
|
||||
|
@@ -409,7 +409,7 @@ class GuestController extends Controller
|
||||
->first();
|
||||
if ($otp != null) {
|
||||
$otp_length = strlen(Input::get('otp'));
|
||||
if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) {
|
||||
if ($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp'))) {
|
||||
$otp2 = Hash::make(Input::get('otp'));
|
||||
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
||||
$date2 = date('Y-m-d h:i:sa');
|
||||
|
@@ -12,20 +12,20 @@ use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Utility\Date_time_format;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\User;
|
||||
Use Illuminate\Support\Facades\Artisan;
|
||||
// classes
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use DB;
|
||||
// classes
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Hash;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\Request as Input;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use UnAuth;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use UnAuth;
|
||||
|
||||
/**
|
||||
* |=======================================================================
|
||||
|
@@ -4,12 +4,8 @@ namespace App\Http\Controllers\Update;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class SyncFaveoToLatestVersion extends Controller
|
||||
{
|
||||
@@ -35,14 +31,14 @@ class SyncFaveoToLatestVersion extends Controller
|
||||
|
||||
$seederPath = base_path('database'.DIRECTORY_SEPARATOR.'seeders');
|
||||
|
||||
if(file_exists($seederPath)){
|
||||
if (file_exists($seederPath)) {
|
||||
$seederVersions = scandir($seederPath);
|
||||
|
||||
natsort($seederVersions);
|
||||
$formattedOlderVersion = $olderVersion;
|
||||
foreach ($seederVersions as $version) {
|
||||
if(version_compare($this->getPhpComaptibleVersion($version), $formattedOlderVersion) == 1){
|
||||
Artisan::call('db:seed',['--class' => "Database\Seeders\\$version\DatabaseSeeder", '--force' => true]);
|
||||
if (version_compare($this->getPhpComaptibleVersion($version), $formattedOlderVersion) == 1) {
|
||||
Artisan::call('db:seed', ['--class' => "Database\Seeders\\$version\DatabaseSeeder", '--force' => true]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +51,7 @@ class SyncFaveoToLatestVersion extends Controller
|
||||
}
|
||||
|
||||
$version = System::value('version') ?: '0.0.0';
|
||||
|
||||
return $this->getPhpComaptibleVersion($version);
|
||||
}
|
||||
|
||||
|
@@ -98,7 +98,7 @@ class UpgradeController extends Controller
|
||||
$dlHandler = fopen($this->dir.'/UPDATES/'.'/faveo-helpdesk-master.zip', 'w');
|
||||
if (!fwrite($dlHandler, $newUpdate)) {
|
||||
echo '<p>Could not save new update. Operation aborted.</p>';
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
fclose($dlHandler);
|
||||
echo '<p>Update Downloaded And Saved</p>';
|
||||
@@ -205,7 +205,7 @@ class UpgradeController extends Controller
|
||||
echo "<li style='color:red;'>".$ex->getMessage().'</li>';
|
||||
echo '</ul>';
|
||||
}
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function deleteBarNotification($key)
|
||||
@@ -293,7 +293,7 @@ class UpgradeController extends Controller
|
||||
}
|
||||
} else {
|
||||
echo '<p>Latest code found. <a href='.url('file-upgrade?dodownload=true').'>» Download Now?</a></p>';
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
echo '<p>Update already downloaded.</p>';
|
||||
@@ -302,7 +302,7 @@ class UpgradeController extends Controller
|
||||
$updated = $this->doUpdate();
|
||||
} else {
|
||||
echo '<p>Update ready. <a href='.url('file-upgrade?doUpdate=true').'>» Install Now?</a></p>';
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($updated == true) {
|
||||
|
@@ -4,7 +4,6 @@ namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Model\helpdesk\Settings\CommonSettings;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
|
||||
/**
|
||||
* AgentRequest.
|
||||
|
@@ -129,7 +129,7 @@ class ClientRequest extends Request
|
||||
{
|
||||
$settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first();
|
||||
$email_mandatory = $settings->select('status')->where('option_name', '=', 'email_mandatory')->first();
|
||||
if (($email_mandatory->status == 0 || $email_mandatory->status == '0')) {
|
||||
if ($email_mandatory->status == 0 || $email_mandatory->status == '0') {
|
||||
if (!\Auth::check()) {
|
||||
return [
|
||||
'Name' => 'required',
|
||||
|
@@ -13,6 +13,6 @@ class System extends BaseModel
|
||||
protected $fillable = [
|
||||
|
||||
'id', 'status', 'url', 'name', 'department', 'page_size', 'log_level', 'purge_log', 'name_format',
|
||||
'time_farmat', 'date_format', 'date_time_format', 'day_date_time', 'time_zone', 'content', 'api_key', 'api_enable', 'api_key_mandatory', 'version'
|
||||
'time_farmat', 'date_format', 'date_time_format', 'day_date_time', 'time_zone', 'content', 'api_key', 'api_enable', 'api_key_mandatory', 'version',
|
||||
];
|
||||
}
|
||||
|
@@ -2,10 +2,8 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\Update\BarNotification;
|
||||
use Illuminate\Queue\Events\JobFailed;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Dusk\DuskServiceProvider;
|
||||
|
@@ -26,7 +26,6 @@ class EventServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
|
@@ -51,18 +51,18 @@ class DatabaseSeeder extends Seeder
|
||||
$tables = Schema::getAllTables();
|
||||
|
||||
foreach ($tables as $table) {
|
||||
$tableName = (array)$table;
|
||||
$tableName = (array) $table;
|
||||
$tableName = reset($tableName);
|
||||
|
||||
$columns = Schema::getColumnListing($tableName);
|
||||
|
||||
foreach ($columns as $column) {
|
||||
if (Schema::getColumnType($tableName, $column) == 'string') {
|
||||
Schema::table($tableName, function ($table) use($column) {
|
||||
Schema::table($tableName, function ($table) use ($column) {
|
||||
$table->string($column)->nullable()->change();
|
||||
});
|
||||
} elseif (Schema::getColumnType($tableName, $column) == 'boolean') {
|
||||
Schema::table($tableName, function ($table) use($column) {
|
||||
Schema::table($tableName, function ($table) use ($column) {
|
||||
$table->boolean($column)->default(0)->change();
|
||||
});
|
||||
}
|
||||
|
@@ -527,7 +527,7 @@ Route::middleware('web')->group(function () {
|
||||
// show ticket via have a ticket
|
||||
Route::get('show-ticket/{id}/{code}', [Client\helpdesk\UnAuthController::class, 'showTicketCode'])->name('show.ticket'); //detail ticket information
|
||||
|
||||
//testing ckeditor
|
||||
//testing ckeditor
|
||||
//===================================================================================
|
||||
Route::middleware('auth')->group(function () {
|
||||
Route::get('client-profile', [Client\helpdesk\GuestController::class, 'getProfile'])->name('client.profile'); /* User profile get */
|
||||
|
Reference in New Issue
Block a user