Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2485279
ForceDeleteCommand.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
935 B
Referenced Files
None
Subscribers
None
ForceDeleteCommand.php
View Options
<?php
namespace
App\Console\Commands\User
;
use
App\Console\Command
;
use
Illuminate\Support\Facades\DB
;
class
ForceDeleteCommand
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'user:force-delete {user}'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'Delete a user for realz'
;
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
$user
=
$this
->
getUser
(
$this
->
argument
(
'user'
),
true
);
if
(!
$user
)
{
$this
->
error
(
"User not found."
);
return
1
;
}
if
(!
$user
->
trashed
())
{
$this
->
error
(
"The user is not yet deleted."
);
return
1
;
}
DB
::
beginTransaction
();
$user
->
forceDelete
();
DB
::
commit
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 21, 11:51 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
387486
Default Alt Text
ForceDeleteCommand.php (935 B)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment