firstcommit
This commit is contained in:
BIN
app/Helpers/.DS_Store
vendored
Normal file
BIN
app/Helpers/.DS_Store
vendored
Normal file
Binary file not shown.
33
app/Helpers/Helper.php
Normal file
33
app/Helpers/Helper.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
use Modules\Estimate\Models\Estimate;
|
||||
|
||||
function getRouteList()
|
||||
{
|
||||
$routes = Route::getRoutes();
|
||||
$ignoreRoutes = ['debugbar', 'login', 'register', 'logout', 'post', 'sanctum', 'ignition', 'unisharp', 'errorpage', 'form7', 'master', 'hr', 'setting', 'nepalidictonary', 'api'];
|
||||
$routeNameArr = [];
|
||||
foreach ($routes as $value) {
|
||||
if (!is_null($value)) {
|
||||
$routeName = explode('.', $value->getName());
|
||||
if (is_array($routeName) && !empty($routeName[0])) {
|
||||
if (!in_array($routeName[0], $ignoreRoutes)) {
|
||||
$routeNameArr[$routeName[0]][] = $value->getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $routeNameArr;
|
||||
}
|
||||
|
||||
function generateEstimateNumber()
|
||||
{
|
||||
$lastEstimate = Estimate::withTrashed()->latest()->first();
|
||||
|
||||
if ($lastEstimate) {
|
||||
$newEstimateNumber = intval($lastEstimate->estimate_no) + 1;
|
||||
return $newEstimateNumber;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user