Melakukan Perubahan di admin
This commit is contained in:
@@ -11,6 +11,8 @@ use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Str;
|
||||
use Hash;
|
||||
use illuminate\Support\Facades\DB;
|
||||
use PhpParser\Node\Expr\Exit_;
|
||||
|
||||
class MstPenggunaController extends Controller
|
||||
{
|
||||
@@ -169,6 +171,64 @@ class MstPenggunaController extends Controller
|
||||
->with('success','Lock upload data sudah diubah!');
|
||||
}
|
||||
|
||||
public function lockTambahData($userId="", $reset=0, Request $req)
|
||||
{
|
||||
$updateValue = [
|
||||
"lock_tambah_data"=>$reset == 0 ? 1:0,
|
||||
"lock_upload_by"=>Auth::user()->id
|
||||
];
|
||||
|
||||
|
||||
if (empty($userId))
|
||||
{
|
||||
User::query()->update($updateValue);
|
||||
}else{
|
||||
User::where(["id"=>$userId])->update($updateValue);
|
||||
}
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','Lock Tambah data sudah diubah!');
|
||||
}
|
||||
|
||||
|
||||
public function lockUbahData($userId="", $reset=0, Request $req)
|
||||
{
|
||||
$updateValue = [
|
||||
"lock_ubah_data"=>$reset == 0 ? 1:0,
|
||||
"lock_upload_by"=>Auth::user()->id
|
||||
];
|
||||
|
||||
if (empty($userId))
|
||||
{
|
||||
User::query()->update($updateValue);
|
||||
}else{
|
||||
User::where(["id"=>$userId])->update($updateValue);
|
||||
}
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','Lock Ubah data sudah diubah!');
|
||||
}
|
||||
|
||||
|
||||
public function lockHapusData($userId="", $reset=0, Request $req)
|
||||
{
|
||||
$updateValue = [
|
||||
"lock_hapus_data"=>$reset == 0 ? 1:0,
|
||||
"lock_upload_by"=>Auth::user()->id
|
||||
];
|
||||
|
||||
if (empty($userId))
|
||||
{
|
||||
User::query()->update($updateValue);
|
||||
}else{
|
||||
User::where(["id"=>$userId])->update($updateValue);
|
||||
}
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','Lock Hapus data sudah diubah!');
|
||||
}
|
||||
|
||||
|
||||
public function resetPass(User $user)
|
||||
{
|
||||
$random = Str::random(8);
|
||||
|
||||
Reference in New Issue
Block a user