Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

4jean/lav_sms

942 stars
2 code files
View 4jean/lav_sms on GitHub

app/Helpers/Qs.php

Open in GitHub
class Qs
{
//
public static function getDefaultUserImage()
{
return asset('global_assets/images/user.png');
}
 
public static function getTeamSA()
{
return ['admin', 'super_admin'];
}
//
public static function getStaff($remove=[])
{
$data = ['super_admin', 'admin', 'teacher', 'accountant', 'librarian'];
return $remove ? array_values(array_diff($data, $remove)) : $data;
}
 
public static function getStaffRecord($remove = [])
{
$data = ['emp_date',];
 
return $remove ? array_values(array_diff($data, $remove)) : $data;
}
//
}

app/Http/Controllers/SupportTeam/UserController.php

Open in GitHub
use App\Helpers\Qs;
 
class UserController extends Controller
{
//
public function store(UserRequest $req)
{
$user_type = $this->user->findType($req->user_type)->title;
 
$data = $req->except(Qs::getStaffRecord());
$data['name'] = ucwords($req->name);
$data['user_type'] = $user_type;
$data['photo'] = Qs::getDefaultUserImage();
$data['code'] = strtoupper(Str::random(10));
 
$user_is_staff = in_array($user_type, Qs::getStaff());
$user_is_teamSA = in_array($user_type, Qs::getTeamSA());
//
}
//

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.