Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
L
Liman MYS - Çekirdek
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
liman
Liman MYS - Çekirdek
Commits
22b1a724
Kaydet (Commit)
22b1a724
authored
Mar 31, 2021
tarafından
Baran Sekin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refactoring validations to provide straight error message
üst
641f677b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
31 deletions
+6
-31
MainController.php
app/Http/Controllers/Extension/MainController.php
+3
-8
RoleController.php
app/Http/Controllers/Roles/RoleController.php
+1
-8
RoleMappingController.php
app/Http/Controllers/Roles/RoleMappingController.php
+2
-15
No files found.
app/Http/Controllers/Extension/MainController.php
Dosyayı görüntüle @
22b1a724
...
...
@@ -12,7 +12,6 @@ use Illuminate\Http\JsonResponse;
use
Illuminate\Http\Response
;
use
Illuminate\Support\Str
;
use
Illuminate\View\View
;
use
Illuminate\Support\Facades\Validator
;
use
App\Jobs\ExtensionUpdaterJob
;
use
Illuminate\Contracts\Bus\Dispatcher
;
use
App\System\Command
;
...
...
@@ -88,14 +87,10 @@ class MainController extends Controller
"request"
=>
request
()
->
all
(),
]);
$flag
=
Validator
::
make
(
request
()
->
all
(),
[
'extension'
=>
'required
|
max:5000000'
,
validate
(
[
'extension'
=>
'required
|
max:5000000'
,
]);
try
{
$flag
->
validate
();
}
catch
(
\Exception
$exception
)
{
return
respond
(
"Lütfen geçerli bir eklenti giriniz."
,
201
);
}
$verify
=
false
;
$zipFile
=
request
()
->
file
(
'extension'
);
if
(
...
...
app/Http/Controllers/Roles/RoleController.php
Dosyayı görüntüle @
22b1a724
...
...
@@ -10,7 +10,6 @@ use App\Models\Permission;
use
App\Models\Extension
;
use
App\Models\RoleMapping
;
use
App\Models\Server
;
use
Illuminate\Support\Facades\Validator
;
class
RoleController
extends
Controller
{
...
...
@@ -89,16 +88,10 @@ class RoleController extends Controller
"request"
=>
request
()
->
all
(),
]);
$flag
=
Validator
::
make
(
request
()
->
all
(),
[
validate
(
[
'name'
=>
[
'required'
,
'string'
,
'max:255'
,
'unique:roles'
],
]);
try
{
$flag
->
validate
();
}
catch
(
\Exception
$exception
)
{
return
respond
(
"Lütfen geçerli veri giriniz."
,
201
);
}
$role
=
Role
::
create
([
"name"
=>
request
(
'name'
),
]);
...
...
app/Http/Controllers/Roles/RoleMappingController.php
Dosyayı görüntüle @
22b1a724
...
...
@@ -7,7 +7,6 @@ use App\Models\LdapRestriction;
use
Illuminate\Http\Request
;
use
App\Models\Role
;
use
App\Models\RoleMapping
;
use
Illuminate\Support\Facades\Validator
;
class
RoleMappingController
extends
Controller
{
...
...
@@ -23,17 +22,11 @@ class RoleMappingController extends Controller
*/
public
function
add
()
{
$flag
=
Validator
::
make
(
request
()
->
all
(),
[
validate
(
[
'dn'
=>
[
'required'
,
'string'
],
'role_id'
=>
[
'required'
,
'exists:roles,id'
],
]);
try
{
$flag
->
validate
();
}
catch
(
\Exception
$exception
)
{
return
respond
(
"Lütfen geçerli veri giriniz."
,
201
);
}
RoleMapping
::
create
([
"dn"
=>
request
(
'dn'
),
"role_id"
=>
request
(
'role_id'
),
...
...
@@ -54,16 +47,10 @@ class RoleMappingController extends Controller
*/
public
function
delete
()
{
$flag
=
Validator
::
make
(
request
()
->
all
(),
[
validate
(
[
'role_mapping_id'
=>
[
'required'
,
'exists:role_mappings,id'
],
]);
try
{
$flag
->
validate
();
}
catch
(
\Exception
$exception
)
{
return
respond
(
"Lütfen geçerli veri giriniz."
,
201
);
}
RoleMapping
::
find
(
request
(
'role_mapping_id'
))
->
delete
();
return
respond
(
"Rol eşleştirmesi başarıyla silindi."
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment