Route::model PHP Method

model() public static method

Register a model binder for a wildcard.
public static model ( string $key, string $class, Closure | null $callback = null ) : void
$key string
$class string
$callback Closure | null
return void
        public static function model($key, $class, $callback = null)
        {
            \Illuminate\Routing\Router::model($key, $class, $callback);
        }

Usage Example

Example #1
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        foreach ($this->_group_by_city() as $city => $venues) {
            ?>

<article>
	<header>
		<h4><?php 
            echo HTML::chars($city);
            ?>
</h4>
	</header>

	<ul class="unstyled block-grid two-up">
	<?php 
            foreach ($venues as $venue) {
                ?>

		<li><?php 
                echo HTML::anchor(Route::model($venue), HTML::chars($venue->name));
                ?>
</li>

	<?php 
            }
            ?>
	</ul>

</article>

<?php 
        }
        return ob_get_clean();
    }
All Usage Examples Of Route::model