/
home
/
techb158
/
dev.balacoffee.com
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
/home/techb158/dev.balacoffee.com/vendor/laravel/framework/src/Illuminate/Routing
mkdir
upload
Name
Size
Mode
Actions
Console/
-
0755
rm
Contracts/
-
0755
rm
Events/
-
0755
rm
Exceptions/
-
0755
rm
Matching/
-
0755
rm
Middleware/
-
0755
rm
AbstractRouteCollection.php
7950
0644
edit
dl
rm
CompiledRouteCollection.php
9005
0644
edit
dl
rm
composer.json
1465
0644
edit
dl
rm
Controller.php
1660
0644
edit
dl
rm
ControllerDispatcher.php
2309
0644
edit
dl
rm
ControllerMiddlewareOptions.php
1013
0644
edit
dl
rm
CreatesRegularExpressionRouteConstraints.php
1833
0644
edit
dl
rm
ImplicitRouteBinding.php
2980
0644
edit
dl
rm
LICENSE.md
1075
0644
edit
dl
rm
MiddlewareNameResolver.php
3178
0644
edit
dl
rm
PendingResourceRegistration.php
5788
0644
edit
dl
rm
Pipeline.php
1503
0644
edit
dl
rm
RedirectController.php
1208
0644
edit
dl
rm
Redirector.php
7396
0644
edit
dl
rm
ResourceRegistrar.php
14927
0644
edit
dl
rm
ResponseFactory.php
7768
0644
edit
dl
rm
Route.php
30468
0644
edit
dl
rm
RouteAction.php
3442
0644
edit
dl
rm
RouteBinding.php
2750
0644
edit
dl
rm
RouteCollection.php
7051
0644
edit
dl
rm
RouteCollectionInterface.php
2332
0644
edit
dl
rm
RouteDependencyResolverTrait.php
3470
0644
edit
dl
rm
RouteFileRegistrar.php
641
0644
edit
dl
rm
RouteGroup.php
2753
0644
edit
dl
rm
RouteParameterBinder.php
3118
0644
edit
dl
rm
Router.php
36211
0644
edit
dl
rm
RouteRegistrar.php
7501
0644
edit
dl
rm
RouteSignatureParameters.php
1457
0644
edit
dl
rm
RouteUri.php
1330
0644
edit
dl
rm
RouteUrlGenerator.php
9296
0644
edit
dl
rm
RoutingServiceProvider.php
6084
0644
edit
dl
rm
SortedMiddleware.php
3664
0644
edit
dl
rm
UrlGenerator.php
20442
0644
edit
dl
rm
ViewController.php
869
0644
edit
dl
rm
Edit:
/home/techb158/dev.balacoffee.com/vendor/laravel/framework/src/Illuminate/Routing/RouteBinding.php
(2750B)
<?php namespace Illuminate\Routing; use Closure; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Support\Str; class RouteBinding { /** * Create a Route model binding for a given callback. * * @param \Illuminate\Container\Container $container * @param \Closure|string $binder * @return \Closure */ public static function forCallback($container, $binder) { if (is_string($binder)) { return static::createClassBinding($container, $binder); } return $binder; } /** * Create a class based binding using the IoC container. * * @param \Illuminate\Container\Container $container * @param string $binding * @return \Closure */ protected static function createClassBinding($container, $binding) { return function ($value, $route) use ($container, $binding) { // If the binding has an @ sign, we will assume it's being used to delimit // the class name from the bind method name. This allows for bindings // to run multiple bind methods in a single class for convenience. [$class, $method] = Str::parseCallback($binding, 'bind'); $callable = [$container->make($class), $method]; return $callable($value, $route); }; } /** * Create a Route model binding for a model. * * @param \Illuminate\Container\Container $container * @param string $class * @param \Closure|null $callback * @return \Closure * * @throws \Illuminate\Database\Eloquent\ModelNotFoundException */ public static function forModel($container, $class, $callback = null) { return function ($value) use ($container, $class, $callback) { if (is_null($value)) { return; } // For model binders, we will attempt to retrieve the models using the first // method on the model instance. If we cannot retrieve the models we'll // throw a not found exception otherwise we will return the instance. $instance = $container->make($class); if ($model = $instance->resolveRouteBinding($value)) { return $model; } // If a callback was supplied to the method we will call that to determine // what we should do when the model is not found. This just gives these // developer a little greater flexibility to decide what will happen. if ($callback instanceof Closure) { return $callback($value); } throw (new ModelNotFoundException)->setModel($class); }; } }
Save
cmd:
run