{"id":4719,"date":"2020-08-11T15:55:33","date_gmt":"2020-08-11T12:55:33","guid":{"rendered":"https:\/\/elzero.org\/?p=4719"},"modified":"2020-08-11T15:55:59","modified_gmt":"2020-08-11T12:55:59","slug":"laravel-create-the-named-routes","status":"publish","type":"post","link":"https:\/\/elzero.org\/old\/laravel-create-the-named-routes\/","title":{"rendered":"Create The Named Routes"},"content":{"rendered":"<h3>\u0627\u0644 Code \u0627\u0644\u0645\u0648\u062c\u0648\u062f \u0641\u064a \u0627\u0644\u062f\u0631\u0633<\/h3>\r\n\r\n<div class=\"file-name\">routes\/web.php<\/div>\r\n<script type=\"text\/plain\" class=\"language-php\">\r\nRoute::get('\/', function () {\r\n  return view('pages.welcome');\r\n})->name(\"home\");\r\n\r\nRoute::get('\/about-us', function () {\r\n  return view(\"pages.about\", []);\r\n})->name(\"about\");\r\n\r\n\/\/ (URI, View, Array Of Data)\r\n\r\nRoute::view('contact-me', \"pages.contact\", [\r\n  'page_name' => 'Contact Me Page',\r\n  'page_description' => \"<script>This Is Description&lt;\/script>\"\r\n])->name(\"contact\");\r\n\r\nRoute::get('category\/{id}', function ($id) {\r\n  $cats = [\r\n    '1' => 'Games',\r\n    '2' => 'Programming',\r\n    '3' => 'Books'\r\n  ];\r\n\r\n  return view(\"pages.category\", [\r\n    'the_id' => $cats[$id] ?? \"This Id Is Not Found\"\r\n  ]);\r\n});\r\n<\/script>\r\n\r\n<hr>\r\n\r\n<div class=\"file-name\">resources\/views\/layout\/navbar.blade.php<\/div>\r\n<script type=\"text\/plain\" class=\"language-html\">\r\n<ul class=\"navbar\">\r\n  <li><a href=\"{{ route(\"home\") }}\">Home<\/a><\/li>\r\n  <li><a href=\"{{ route(\"about\") }}\">About<\/a><\/li>\r\n  <li><a href=\"{{ route(\"contact\") }}\">Contact<\/a><\/li>\r\n<\/ul>\r\n<\/script>\r\n\r\n<h3>\u0645\u0644\u0627\u062d\u0638\u0627\u062a \u0627\u0644\u062f\u0631\u0633<\/h3>\r\n\u0644\u0627 \u062a\u0648\u062c\u062f \u0645\u0644\u0627\u062d\u0638\u0627\u062a \u062d\u0627\u0644\u064a\u0627","protected":false},"excerpt":{"rendered":"<p>\u0627\u0644 Code \u0627\u0644\u0645\u0648\u062c\u0648\u062f \u0641\u064a \u0627\u0644\u062f\u0631\u0633 routes\/web.php resources\/views\/layout\/navbar.blade.php \u0645\u0644\u0627\u062d\u0638\u0627\u062a \u0627\u0644\u062f\u0631\u0633 \u0644\u0627 \u062a\u0648\u062c\u062f \u0645\u0644\u0627\u062d\u0638\u0627\u062a \u062d\u0627\u0644\u064a\u0627<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[715],"tags":[],"class_list":["post-4719","post","type-post","status-publish","format-standard","hentry","category-mastering-laravel"],"_links":{"self":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/4719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/comments?post=4719"}],"version-history":[{"count":2,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/4719\/revisions"}],"predecessor-version":[{"id":4721,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/4719\/revisions\/4721"}],"wp:attachment":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/media?parent=4719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/categories?post=4719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/tags?post=4719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}