{"id":208678,"date":"2014-01-11T20:46:03","date_gmt":"2014-01-11T16:46:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208678"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208678","title":{"rendered":"<span class=\"post_title\">\u0423\u0434\u043e\u0431\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f URL (\u0427\u041f\u0423). Laravel 4 + \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 URL \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u043e\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0443\u0436 \u0438 \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u043e\u043d\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e, \u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u0437\u0430\u0442\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u043d\u0430 <s>\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430<\/s> \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0422\u0430\u043a \u0436\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c URL. \u0410\u0445 \u0434\u0430, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <b>Laravel<\/b> \u0438 \u0438\u043d\u0441\u0442\u0443\u043c\u0435\u043d\u0442\u044b \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u044b \u043f\u043e\u0434 \u043d\u0435\u0433\u043e.<\/p>\n<h4>\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/IvanLemeshev\/laravel4-cyrillic-slug\">Laravel 4 Cyrillic Slug<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/cviebrock\/eloquent-sluggable\">Eloquent Sluggable<\/a><\/li>\n<\/ul>\n<p>  \u042d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u0442.<\/p>\n<h4>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h4>\n<p>  \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 URL \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0411\u0414 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0438\u043c \u043f\u043e <b>\/resource\/unique-resource-url<\/b> \u0432\u043c\u0435\u0441\u0442\u043e <b>\/resource\/1<\/b>.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c<\/h4>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043f\u043e \u0421\u0442\u0440\u0430\u043d\u0430\u043c \u0438 \u0413\u043e\u0440\u043e\u0434\u0430\u043c, \u043d\u043e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043b\u0435\u0433\u043a\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f, \u043a\u0430\u043a\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c\/\u0433\u043e\u0440\u043e\u0434 \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u0440\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u041f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0441\u0430\u0439\u0442\u0430.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<pre><code class=\"bash\">composer create-project laravel\/laravel habr_url --prefer-dist <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043e\u0442\u043a\u044b\u0432\u0430\u0435\u043c <i>composer.json<\/i> \u0432 \u043a\u043e\u0440\u043d\u0435 <i>habr_url<\/i> \u0438 \u0432\u043d\u043e\u0441\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u044b \u0432 <b>require<\/b>:<\/p>\n<pre><code>{     &quot;name&quot;: &quot;laravel\/laravel&quot;,     &quot;description&quot;: &quot;The Laravel Framework.&quot;,     &quot;keywords&quot;: [&quot;framework&quot;, &quot;laravel&quot;],     &quot;license&quot;: &quot;MIT&quot;,     &quot;require&quot;: {         &quot;laravel\/framework&quot;: &quot;4.1.*&quot;,         &quot;ivanlemeshev\/laravel4-cyrillic-slug&quot;: &quot;dev-master&quot;,         &quot;cviebrock\/eloquent-sluggable&quot;: &quot;1.0.*&quot;,         &quot;way\/generators&quot;: &quot;dev-master&quot;     },     &quot;autoload&quot;: {         &quot;classmap&quot;: [             &quot;app\/commands&quot;,             &quot;app\/controllers&quot;,             &quot;app\/models&quot;,             &quot;app\/database\/migrations&quot;,             &quot;app\/database\/seeds&quot;,             &quot;app\/tests\/TestCase.php&quot;         ]     },     &quot;scripts&quot;: {         &quot;post-install-cmd&quot;: [             &quot;php artisan optimize&quot;         ],         &quot;post-update-cmd&quot;: [             &quot;php artisan clear-compiled&quot;,             &quot;php artisan optimize&quot;         ],         &quot;post-create-project-cmd&quot;: [             &quot;php artisan key:generate&quot;         ]     },     &quot;config&quot;: {         &quot;preferred-install&quot;: &quot;dist&quot;     },     &quot;minimum-stability&quot;: &quot;dev&quot; } <\/code><\/pre>\n<p>  <code>&quot;way\/generators&quot;: &quot;dev-master&quot;<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u0443 <code>composer update<\/code> \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432\u043d\u043e\u0441\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 <i>app\/config\/app.php<\/i>:<\/p>\n<pre><code class=\"php\">&lt;?php  return array(     \/\/ ...     'providers' =&gt; array(         \/\/ ...         'Ivanlemeshev\\Laravel4CyrillicSlug\\SlugServiceProvider',         'Cviebrock\\EloquentSluggable\\SluggableServiceProvider',         'Way\\Generators\\GeneratorsServiceProvider',     ),     \/\/ ...     'aliases' =&gt; array(         \/\/ ...         'Slug' =&gt; 'Ivanlemeshev\\Laravel4CyrillicSlug\\Facades\\Slug',         'Sluggable' =&gt; 'Cviebrock\\EloquentSluggable\\Facades\\Sluggable',     ), ); ?&gt; <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441 <b>Slug<\/b> \u0434\u0430\u0441\u0442 \u043d\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c URL \u0438\u0437 \u043a\u0438\u0440\u0440\u0438\u043b\u0438\u0446\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <b>Str<\/b> \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043b\u0430\u0442\u0438\u043d\u0438\u0446\u0435\u0439. \u041e <b>Sluggable<\/b> \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<h5>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\">php artisan generate:scaffold create_countries_table --fields=&quot;name:string:unique, code:string[2]:unique&quot; php artisan generate:scaffold create_cities_table --fields=&quot;name:string, slug:string:unique, country_id:integer:unsigned&quot; php artisan generate:scaffold create_products_table --fields=&quot;name:string, slug:string:unique, price:integer, city_id:integer:unsigned&quot; <\/code><\/pre>\n<p>  \u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043a\u043b\u044e\u0447\u0435\u0439:<\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/database\/migrations\/\u0425\u0425\u0425\u0425_\u0425\u0425_\u0425\u0425_\u0425\u0425\u0425\u0425\u0425\u0425_create_cities_table.php class CreateCitiesTable extends Migration {     \/\/ ...     public function up()     {         Schema::create('cities', function(Blueprint $table) {             $table-&gt;increments('id');             $table-&gt;string('name');             $table-&gt;string('slug')-&gt;unique();             $table-&gt;integer('country_id')-&gt;unsigned()-&gt;index();             $table-&gt;foreign('country_id')-&gt;references('id')-&gt;on('countries')-&gt;onDelete('cascade');             $table-&gt;timestamps();         });     }     \/\/ ... } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/database\/migrations\/\u0425\u0425\u0425\u0425_\u0425\u0425_\u0425\u0425_\u0425\u0425\u0425\u0425\u0425\u0425_create_products_table.php class CreateProductsTable extends Migration {     \/\/ ...     public function up()     {         Schema::create('products', function(Blueprint $table) {             $table-&gt;increments('id');             $table-&gt;string('name');             $table-&gt;string('slug')-&gt;unique();             $table-&gt;integer('price');             $table-&gt;integer('city_id')-&gt;unsigned()-&gt;index();             $table-&gt;foreign('city_id')-&gt;references('id')-&gt;on('cities')-&gt;onDelete('cascade');             $table-&gt;timestamps();         });     }     \/\/ ... } <\/code><\/pre>\n<p>  \u0410 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0421\u0442\u0440\u0430\u043d \u0438 \u0413\u043e\u0440\u043e\u0434\u043e\u0432 \u0432 \u0411\u0414 \u0447\u0435\u0440\u0435\u0437 <code>seeds<\/code>. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 <i>app\/database\/seeds<\/i> \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/database\/seeds\/CountriesTableSeeder.php class CountriesTableSeeder extends Seeder {      public function run()     {         $countries = array(             array('name' =&gt; '\u0420\u043e\u0441\u0441\u0438\u044f',  'code' =&gt; 'ru'),             array('name' =&gt; '\u0423\u043a\u0440\u0430\u0438\u043d\u0430', 'code' =&gt; 'ua')         );          \/\/ Uncomment the below to run the seeder         DB::table('countries')-&gt;insert($countries);     }  } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/database\/seeds\/CitiesTableSeeder.php class CitiesTableSeeder extends Seeder {      public function run()     {         \/\/ Uncomment the below to wipe the table clean before populating         \/\/ DB::table('cities')-&gt;truncate();          $cities = array(             array('name' =&gt; '\u041c\u043e\u0441\u043a\u0432\u0430', 'slug' =&gt; Slug::make('\u041c\u043e\u0441\u043a\u0432\u0430'), 'country_id' =&gt; 1),             array('name' =&gt; '\u0421\u0430\u043d\u043a\u0442-\u041f\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433', 'slug' =&gt; Slug::make('\u0421\u0430\u043d\u043a\u0442-\u041f\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433'), 'country_id' =&gt; 1),             array('name' =&gt; '\u041a\u0438\u0435\u0432', 'slug' =&gt; Slug::make('\u041a\u0438\u0435\u0432'), 'country_id' =&gt; 2),         );          \/\/ Uncomment the below to run the seeder         DB::table('cities')-&gt;insert($cities);     }  } <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>Slug::make($input)<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <code>$input<\/code> \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0437 \u043d\u0435\u0435 \u0447\u0442\u043e-\u0442\u043e \u043d\u0430 \u043f\u043e\u0434\u043e\u0431\u0438\u0438 <code>moskva<\/code> \u0438\u043b\u0438 <code>sankt-peterburg<\/code>.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0411\u0414:<\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/config\/database.php return array(     \/\/ ...     'connections' =&gt; array(         \/\/ ...         'mysql' =&gt; array(             'driver'    =&gt; 'mysql',             'host'      =&gt; 'localhost',             'database'  =&gt; 'habr_url',             'username'  =&gt; 'habr_url',             'password'  =&gt; 'habr_url',             'charset'   =&gt; 'utf8',             'collation' =&gt; 'utf8_unicode_ci',             'prefix'    =&gt; '',         ),     ),     \/\/ ... ); <\/code><\/pre>\n<p>  \u0418 \u0432\u043d\u043e\u0441\u0438\u043c \u0441\u0445\u0435\u043c\u0443 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0411\u0414.<\/p>\n<pre><code class=\"bash\">php artisan migrate --seed <\/code><\/pre>\n<p>  \u0418 \u0432\u043e\u0442 \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438:<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/6ba\/9a4\/8df\/6ba9a48dfa4c7ede35e1650f08969922.png\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/046\/6a8\/036\/0466a8036234c783ce5d51f418a132be.png\"\/><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u0432\u044f\u0437\u0435\u0439 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432:<\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/models\/Product.php class Product extends Eloquent {     protected $guarded = array();      public static $rules = array(         'name' =&gt; 'required|alpha_num|between:2,255',         'slug' =&gt; 'required|alpha_num|between:2,255|unique:products,slug',         'price' =&gt; 'required|numeric|between:2,255',         'city_id' =&gt; 'required|exists:cities,id'     );      public function city()     {         return $this-&gt;belongsTo('City');     } } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/models\/City.php class City extends Eloquent {     protected $guarded = array();      public static $rules = array(         'name' =&gt; 'required|alpha_num|between:2,255',         'slug' =&gt; 'required|alpha_num|between:2,255|unique:cities,slug',         'country_id' =&gt; 'required|exists:countries,id'     );      public function country()     {         return $this-&gt;belongsTo('Country');     }      public function products()     {         return $this-&gt;hasMany('Product');     } }  <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/models\/Country.php class Country extends Eloquent {     protected $guarded = array();      public static $rules = array(         'name' =&gt; 'required|alpha_num|between:2,255|unique:countries,name',         'code' =&gt; 'required|alpha|size:2|unique:countries,code'     );      public function cities()     {         return $this-&gt;hasMany('City');     }      public function products()     {         return $this-&gt;hasManyThrough('Product', 'City');     } } <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u044b <code>store<\/code> \u0432 <code>CitiesController<\/code> \u0438 <code>ProductsController<\/code>.<\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/models\/CitiesController.php class CitiesController extends BaseController {     \/\/ ...     public function store()     {         $input = Input::all();         $input['slug'] = Slug::make(Input::get('name', '')); \/\/ !\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e         $validation = Validator::make($input, City::$rules);          if ($validation-&gt;passes())         {             $this-&gt;product-&gt;create($input);              return Redirect::route('products.index');         }          return Redirect::route('products.create')             -&gt;withInput()             -&gt;withErrors($validation)             -&gt;with('message', 'There were validation errors.');     }     \/\/ ... } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/models\/ProductsController.php class ProductsController extends BaseController {     \/\/ ...     public function store()     {         $input = Input::all();         $input['slug'] = Slug::make(Input::get('name', '')); \/\/ !\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e         $validation = Validator::make($input, Product::$rules);          if ($validation-&gt;passes())         {             $this-&gt;product-&gt;create($input);              return Redirect::route('products.index');         }          return Redirect::route('products.create')             -&gt;withInput()             -&gt;withErrors($validation)             -&gt;with('message', 'There were validation errors.');     }     \/\/ ... } <\/code><\/pre>\n<p>  \u0418 \u0443\u0431\u0435\u0440\u0435\u043c \u0438\u0437 <i>app\/views\/cities\/create.blade.php<\/i>, <i>app\/views\/cities\/edit.blade.php<\/i>, <i>app\/views\/products\/create.blade.php<\/i>, <i>app\/views\/products\/edit.blade.php<\/i> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0444\u043e\u0440\u043c\u044b.<\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, <code>URL<\/code> \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u043d\u043e \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435\u0442 \u0441 \u0438\u0445 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c? \u0412\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430. \u0410 \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u2014 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 <code>slug<\/code> \u043d\u0430\u043c \u043f\u0440\u0438\u0439\u0434\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441, \u0430 \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u0443\u0436\u0434\u0435 \u0435\u0441\u0442\u044c \u2014 \u0442\u043e \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e. \u0420\u0430\u0431\u043e\u0442\u044b \u043c\u043d\u043e\u0433\u043e, \u0430 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0442. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u0438\u0445 \u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c <code>Eloquent Sluggable<\/code>.<\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0441\u043a\u0438\u043d\u0435\u043c \u0441\u0435\u0431\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f <code>Eloquent Sluggable<\/code>:<\/p>\n<pre><code class=\"bash\">php artisan config:publish cviebrock\/eloquent-sluggable <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0443\u0442 <i>app\/config\/cviebrock\/eloquent-sluggable\/config.php<\/i> \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043e\u043f\u0446\u0438\u044e <code>'method' =&gt; null<\/code> \u043d\u0430 <code>'method' =&gt; array('Slug', 'make')<\/code>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0438\u0437 \u043a\u0438\u0440\u0440\u0438\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0442 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>URL<\/code> \u0432\u043e\u0437\u043b\u043e\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0430\u0441\u0441 <b>Slug<\/b> (\u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e <b>Str<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u0438\u0440\u0440\u0438\u043b\u0438\u0446\u0435\u0439) \u0438 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 <i>make<\/i>.<\/p>\n<p>  \u0427\u0435\u043c \u0445\u043e\u0440\u043e\u0448 \u044d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442? \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0446\u044b\u043f\u0443: \u043e\u0436\u0438\u0434\u0430\u0435\u0442, \u0441\u043e\u0431\u044b\u0442\u0438\u044f <code>eloquent.saving*<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0411\u0414, \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432 \u043f\u043e\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u041c\u043e\u0434\u0435\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <code>slug<\/code>. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/models\/City.php class City extends Eloquent {     protected $guarded = array();      public static $rules = array(         'name' =&gt; 'required|alpha_num|between:2,255',         'country_id' =&gt; 'required|exists:countries,id'     );      \/\/ \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438     public static $sluggable = array(         'build_from' =&gt; 'name',         'save_to'    =&gt; 'slug',     );      public function country()     {         return $this-&gt;belongsTo('Country');     }      public function products()     {         return $this-&gt;hasMany('Product');     } } <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c <code>slug<\/code>, \u0432 \u043d\u043e\u0432\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0435\u0444\u0438\u043a\u0441 <b>-1<\/b>, <b>-2<\/b>, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f <code>slug<\/code> \u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>CitiesController@store<\/code> \u0443\u0431\u0440\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 <code>$input['slug'] = Slug::make(Input::get('name', ''));<\/code>.<\/p>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0438 \u0434\u043b\u044f <code>Product<\/code>:<\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/models\/Product.php class Product extends Eloquent {     protected $guarded = array();      public static $rules = array(         'name' =&gt; 'required|alpha_num|between:2,255',         'price' =&gt; 'required|numeric|between:2,255',         'city_id' =&gt; 'required|exists:cities,id'     );      public static $sluggable = array(         'build_from' =&gt; 'name',         'save_to'    =&gt; 'slug',     );      public function city()     {         return $this-&gt;belongsTo('City');     } } <\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0432\u0435\u0449\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c <code>slug<\/code>, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c <code>$sluggable<\/code> \u0432 \u041c\u043e\u0434\u0435\u043b\u0438 <code>City<\/code> \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/models\/City.php class City extends Eloquent {     protected $guarded = array();      public static $rules = array(         'name' =&gt; 'required|alpha_num|between:2,255',         'slug' =&gt; 'required|alpha_num|between:2,255|unique:cities,slug',         'country_id' =&gt; 'required|exists:countries,id'     );      public static $sluggable = array(         'build_from' =&gt; 'name_with_country_code',         'save_to'    =&gt; 'slug',     );      public function country()     {         return $this-&gt;belongsTo('Country');     }      public function products()     {         return $this-&gt;hasMany('Product');     }      public function getNameWithCountryCodeAttribute() {         return $this-&gt;country-&gt;code . ' ' . $this-&gt;name;     } } <\/code><\/pre>\n<p>  \u0414\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043f\u043e\u043b\u0435 \u0438\u0437 \u041e\u0431\u044a\u0435\u043a\u0442\u0430, \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0445\u0435\u043b\u043f\u0435\u0440.<\/p>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0432 <code>CitiesTableSeeder<\/code> \u0434\u043e\u0431\u044a\u0435\u043c\u0441\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430:<\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/database\/seeds\/CitiesTableSeeder.php class CitiesTableSeeder extends Seeder {      public function run()     {         \/\/ Uncomment the below to wipe the table clean before populating         \/\/ DB::table('cities')-&gt;truncate();          $cities = array(             array('name' =&gt; '\u041c\u043e\u0441\u043a\u0432\u0430', 'country_id' =&gt; 1),             array('name' =&gt; '\u0421\u0430\u043d\u043a\u0442-\u041f\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433', 'country_id' =&gt; 1),             array('name' =&gt; '\u041a\u0438\u0435\u0432', 'country_id' =&gt; 2),         );          \/\/ Uncomment the below to run the seeder         foreach ($cities as $city) {             City::create($city);         }     }  } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043a\u0430\u0442\u0438\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430\u043b\u044c\u0435\u043c \u0438\u0445 \u043f\u043e \u043d\u043e\u0432\u043e\u0439 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438:<\/p>\n<pre><code class=\"bash\">php artisan migrate:refresh --seed <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/a7f\/392\/dda\/a7f392dda08acbf3774e9d905fb7a52a.png\"\/><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432:  <\/p>\n<pre><code class=\"php\">\/\/ \u0444\u0430\u0439\u043b app\/routes.php \/\/ ... Route::get('country\/{code}', array('as' =&gt; 'country', function($code) {     $country = Country::where('code', '=', $code)-&gt;firstOrFail();      return View::make('products', array('products' =&gt; $country-&gt;products)); }));  Route::get('city\/{slug}', array('as' =&gt; 'city', function($slug) {     $city = City::where('slug', '=', $slug)-&gt;firstOrFail();      return View::make('products', array('products' =&gt; $city-&gt;products)); }));  Route::get('product\/{slug}', array('as' =&gt; 'product', function($slug) {     $product = Product::where('slug', '=', $slug)-&gt;firstOrFail();      return View::make('product', compact('product')); })); <\/code><\/pre>\n<p>  \u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432:<\/p>\n<pre><code class=\"php\">&lt;!-- \u0444\u0430\u0439\u043b app\/views\/nav.blade.php --&gt; &lt;ul class=&quot;nav nav-pills&quot;&gt;   @foreach(Country::all() as $country)     &lt;li&gt;&lt;a href=&quot;{{{ route('country', $country-&gt;code) }}}&quot;&gt;{{{ $country-&gt;name }}}&lt;\/a&gt;   @endforeach &lt;\/ul&gt; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">&lt;!-- \u0444\u0430\u0439\u043b app\/views\/products.blade.php --&gt; @extends('layouts.scaffold')  @section('main')  @include('nav')  &lt;h1&gt;Products&lt;\/h1&gt;  @if ($products-&gt;count())   &lt;table class=&quot;table table-striped table-bordered&quot;&gt;     &lt;thead&gt;       &lt;tr&gt;         &lt;th&gt;Name&lt;\/th&gt;         &lt;th&gt;Price&lt;\/th&gt;         &lt;th&gt;City&lt;\/th&gt;       &lt;\/tr&gt;     &lt;\/thead&gt;      &lt;tbody&gt;       @foreach ($products as $product)         &lt;tr&gt;           &lt;td&gt;&lt;a href=&quot;{{{ route('product', $product-&gt;slug)}}}&quot;&gt;{{{ $product-&gt;name }}}&lt;\/a&gt;&lt;\/td&gt;           &lt;td&gt;{{{ $product-&gt;price }}}&lt;\/td&gt;           &lt;td&gt;&lt;a href=&quot;{{{ route('city', $product-&gt;city-&gt;slug) }}}&quot;&gt;{{{ $product-&gt;city-&gt;name }}}&lt;\/a&gt;&lt;\/td&gt;         &lt;\/tr&gt;       @endforeach     &lt;\/tbody&gt;   &lt;\/table&gt; @else   There are no products @endif  @stop <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">&lt;!-- \u0444\u0430\u0439\u043b app\/views\/product.blade.php --&gt; @extends('layouts.scaffold')  @section('main')  @include('nav')  &lt;h1&gt;Product&lt;\/h1&gt;  &lt;table class=&quot;table table-striped table-bordered&quot;&gt;     &lt;thead&gt;         &lt;tr&gt;             &lt;th&gt;Name&lt;\/th&gt;             &lt;th&gt;Price&lt;\/th&gt;             &lt;th&gt;City&lt;\/th&gt;         &lt;\/tr&gt;     &lt;\/thead&gt;      &lt;tbody&gt;         &lt;tr&gt;             &lt;td&gt;{{{ $product-&gt;name }}}&lt;\/td&gt;             &lt;td&gt;{{{ $product-&gt;price }}}&lt;\/td&gt;             &lt;td&gt;{{{ $product-&gt;city-&gt;name }}}&lt;\/td&gt;         &lt;\/tr&gt;     &lt;\/tbody&gt; &lt;\/table&gt;  @stop <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435. <\/p>\n<h4>\u0414\u0435\u043c\u043e \u0438 Git<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/andrewdacenko\/habr-url-laravel4\">GitHub<\/a><\/li>\n<li><a href=\"http:\/\/habr-url.eu1.frbit.net\">Demo<\/a><\/li>\n<\/ul>\n<p>  \u041e\u0448\u0438\u0431\u043a\u0438, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u043b\u0438\u0447\u043a\u0443. \u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043a\u0440\u0438\u0442\u0438\u043a\u0443 \u2014 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/208678\/\"> http:\/\/habrahabr.ru\/post\/208678\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 URL \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u043e\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0443\u0436 \u0438 \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u043e\u043d\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e, \u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u0437\u0430\u0442\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u043d\u0430 <s>\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430<\/s> \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0422\u0430\u043a \u0436\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c URL. \u0410\u0445 \u0434\u0430, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <b>Laravel<\/b> \u0438 \u0438\u043d\u0441\u0442\u0443\u043c\u0435\u043d\u0442\u044b \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u044b \u043f\u043e\u0434 \u043d\u0435\u0433\u043e.<\/p>\n<h4>\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/IvanLemeshev\/laravel4-cyrillic-slug\">Laravel 4 Cyrillic Slug<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/cviebrock\/eloquent-sluggable\">Eloquent Sluggable<\/a><\/li>\n<\/ul>\n<p>  \u042d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u0442.<\/p>\n<h4>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h4>\n<p>  \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 URL \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0411\u0414 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0438\u043c \u043f\u043e <b>\/resource\/unique-resource-url<\/b> \u0432\u043c\u0435\u0441\u0442\u043e <b>\/resource\/1<\/b>.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-208678","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208678"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208678\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}