Navigation Menu

Skip to content

Commit

Permalink
dont delete by default
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 30, 2022
1 parent bb88601 commit 6ddf3b0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Expand Up @@ -52,6 +52,6 @@ class {{ class }} extends Controller
*/
public function destroy({{ parentModel }} ${{ parentModelVariable }})
{
//
abort(404);
}
}
Expand Up @@ -74,6 +74,6 @@ class {{ class }} extends Controller
*/
public function destroy({{ parentModel }} ${{ parentModelVariable }})
{
//
abort(404);
}
}
Expand Up @@ -46,6 +46,6 @@ class {{ class }} extends Controller
*/
public function destroy()
{
//
abort(404);
}
}
Expand Up @@ -66,6 +66,6 @@ class {{ class }} extends Controller
*/
public function destroy()
{
//
abort(404);
}
}
6 changes: 3 additions & 3 deletions src/Illuminate/Routing/ResourceRegistrar.php
Expand Up @@ -26,7 +26,7 @@ class ResourceRegistrar
*
* @var string[]
*/
protected $singletonResourceDefaults = ['show', 'edit', 'update', 'destroy'];
protected $singletonResourceDefaults = ['show', 'edit', 'update'];

/**
* The parameters set for this resource instance.
Expand Down Expand Up @@ -251,8 +251,8 @@ protected function getResourceMethods($defaults, $options)

if (isset($options['creatable'])) {
$methods = isset($options['apiSingleton'])
? array_merge(['store'], $methods)
: array_merge(['create', 'store'], $methods);
? array_merge(['store', 'destroy'], $methods)
: array_merge(['create', 'store', 'destroy'], $methods);

return $this->getResourceMethods(
$methods, array_values(Arr::except($options, ['creatable']))
Expand Down

0 comments on commit 6ddf3b0

Please sign in to comment.