{"id":302013,"date":"2020-04-16T15:01:28","date_gmt":"2020-04-16T15:01:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=302013"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=302013","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u0435\u043c todo \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 Laravel"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/497506\/\"><i><b>\u0421\u0430\u043b\u044e\u0442, \u0445\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0437\u0432\u0430\u043d\u0438\u0435 \u0445\u0430\u0440\u0434\u043a\u043e\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u043c \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u0430. \u0416\u0434\u0435\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0432\u0430\u0448\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0442\u0430\u0442\u044c\u0435, \u0430 \u0437\u0430 \u0431\u043e\u043b\u0435\u0435 \u0445\u0430\u0440\u0434\u043a\u043e\u0440\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u043d\u0430\u0448 \u043a\u0443\u0440\u0441 <a href=\"https:\/\/otus.pw\/bz5Y\/\">\u00abFramework Laravel\u00bb<\/a>. <\/b><\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0k\/zr\/tc\/0kzrtcgvl777bqznfbpicgqsepc.png\">  <\/p>\n<hr>\n<p>   \u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0421\u0435\u0433\u043e\u0434\u043d\u044f, \u0432 \u0441\u0442\u043e\u043b\u044c \u00ab\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0435\u00bb \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e\u0439 todo, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u0430\u0434\u0430\u0447\u0438. \u0417\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Laravel, \u0438 \u0442\u0430\u043a \u043e\u043d\u043e \u0438 \u0435\u0441\u0442\u044c \u2014 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0438\u0445 todo \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u044b, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0435\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e, \u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0435\u0433\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0438 <strike>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043d\u0435\u043b\u0435\u043f\u044b\u0439 \u043a\u043b\u043e\u043d Trello<\/strike>.<br \/>   <a name=\"habracut\"><\/a>   <\/p>\n<h3> \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435 <\/h3>\n<p>   <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hg\/vy\/ak\/hgvyakmhibjsmwd1zethg1wbgmm.gif\"><\/p>\n<p>  \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b, \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 <a href=\"https:\/\/laravel.com\/docs\/5.1\/quickstart\">\u0433\u0430\u0439\u0434<\/a>. \u041e\u043d \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 \u0441 \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u043e\u043c, \u0447\u0435\u043c \u043d\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u041a \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0435\u0433\u043e \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0438 \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 5.1 \u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 Laravel \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 7 \u0432\u0435\u0440\u0441\u0438\u0438 (\u0442\u043e\u043b\u044c\u043a\u043e 3 \u043c\u0430\u0440\u0442\u0430 \u0432\u044b\u0448\u043b\u0430, \u0441\u0432\u0435\u0436\u0435\u043d\u044c\u043a\u0430\u044f)), \u0440\u043e\u0443\u0442\u0438\u043d\u0433 \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u0432 <code>app\/Http\/routes.php<\/code>, \u0430 \u0432 <code>routes\/web.php<\/code> (\u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0434\u0430 \u0443\u0436\u0435 \u0441 6 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c), \u0438 \u0432 \u043e\u0431\u0449\u0435\u043c \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0412 \u0438\u0442\u043e\u0433\u0435, \u0443 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043a\u043e\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vt\/kw\/at\/vtkwatppc_py1c7l9jutt16qouq.png\"><\/p>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u044f \u043f\u043e\u043c\u0435\u043d\u044f\u043b \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0442\u043a\u0438 \u0441 bootstrap \u043d\u0430 bulma. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u043d\u0435 \u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u0430 \u0432\u043e\u0442 \u0432\u0442\u043e\u0440\u044b\u0445 \u0443 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u043a\u043e\u0434\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430 blade \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0439 (\u0445\u043e\u0442\u044f, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043d\u0430\u0440\u0430\u0441\u0442\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0439 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0439 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0434\u0430\u043b\u044c\u0448\u0435, \u043a\u0430\u043a). <\/p>\n<p>  \u042d\u0442\u0443 \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/github.com\/isakura313\/laravel_todo\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0432 \u0432\u0435\u0442\u043a\u0435 \u043c\u0430\u0441\u0442\u0435\u0440 (\u0430 \u0432 \u0432\u0435\u0442\u043a\u0435 new \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435). \u0410\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b \u0435\u0451 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d composer \u0438 laravel:<\/p>\n<pre><code class=\"plaintext\">composer install \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u0444\u0430\u0439\u043b .env, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e .env example, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u043e\u0434 \u0432\u0430\u0448\u0443 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 php artisan key:generate \/\/\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0435 \u043a\u043b\u044e\u0447 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 php artisan serve \/\/\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <\/code><\/pre>\n<p>  <\/p>\n<h5> \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e<\/h5>\n<p>  \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u0441 6 \u0432\u0435\u0440\u0441\u0438\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438 blade \u2014 \u0448\u0430\u0431\u043b\u043e\u043d\u044b:<\/p>\n<pre><code class=\"plaintext\">composer install laravel\/ui php artisan ui vue --auth  <\/code><\/pre>\n<p>  \u0412 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<p>  \u0432 \u043f\u0430\u043f\u043a\u0435 <i>resourses<\/i> \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0430 <i>auth<\/i>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0444\u0430\u0439\u043b\u044b blade \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0430\u0440\u043e\u043b\u044f\u043c. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e blade-\u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0441\u0432\u0435\u0440\u0441\u0442\u0430\u043d\u044b \u0432 <i>bootstrap<\/i>, \u043e\u0434\u043d\u0430\u043a\u043e \u044f \u0438\u0445 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b \u0432 <i>bulma<\/i>, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u043b\u044e\u0441\u0442\u0438 \u043e\u0431\u0449\u043d\u043e\u0441\u0442\u044c css-\u0444\u0440\u0435\u0439\u0432\u043e\u0440\u043a\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u043e\u0431\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u043e\u043c, \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043d\u0435\u043b\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. \u0412 <i>resources<\/i> \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043f\u0430\u043f\u043a\u0443 <i>includes<\/i>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u2014 <i>header<\/i> \u0438 <i>nav<\/i>. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0432 header \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e head \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c bulma, \u0430 \u0432 <code>nav.blade.php<\/code> \u0431\u044b\u043b\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"html\">&lt;nav class=&quot;navbar has-background-black-ter&quot; role=&quot;navigation&quot; aria-label=&quot;main navigation&quot;&gt;   &lt;div class=&quot;navbar-brand&quot;&gt;     &lt;a class=&quot;navbar-item has-text-white is-size-4&quot; href=&quot;\/&quot;&gt;       TODO     &lt;\/a&gt;     &lt;a role=&quot;button&quot; class=&quot;navbar-burger&quot; aria-label=&quot;menu&quot; aria-expanded=&quot;false&quot;&gt;       &lt;span aria-hidden=&quot;true&quot;&gt;&lt;\/span&gt;       &lt;span aria-hidden=&quot;true&quot;&gt;&lt;\/span&gt;       &lt;span aria-hidden=&quot;true&quot;&gt;&lt;\/span&gt;     &lt;\/a&gt;   &lt;\/div&gt;   &lt;div class=&quot;navbar-menu&quot;&gt;     &lt;div class=&quot;navbar-start&quot;&gt;       @if (Auth::check())       &lt;button type=&quot;button&quot; class=&quot;button is-primary&quot;&gt;         &lt;!-- \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d, \u0442\u043e\u0433\u0434\u0430 -&gt;\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0438\u043a --&gt;         {{{ Auth::user()-&gt;name}}}       &lt;\/button&gt;       @else       &lt;!-- \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 --&gt;       &lt;a class=&quot;navbar-item has-text-danger&quot; href=&quot;{{route('register')}}&quot;&gt;\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f&lt;\/a&gt;       &lt;a class=&quot;navbar-item has-text-danger&quot; href=&quot;{{route('login')}}&quot;&gt;\u0412\u043e\u0439\u0442\u0438&lt;\/a&gt;       @endif       @if (Auth::check())       &lt;!-- \u0435\u0441\u043b\u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d, \u0442\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u0432\u044b\u0439\u0442\u0438 --&gt;       &lt;!-- \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0444\u043e\u0440\u043c\u0443 --&gt;        &lt;a class=&quot;navbar-item has-text-danger&quot; href=&quot;{{url('\/logout') }}&quot; onclick=&quot;event.preventDefault();                   document.getElementById('logout-form').submit();&quot;&gt;         \u0412\u044b\u0439\u0442\u0438 &lt;\/a&gt;       &lt;form id=&quot;logout-form&quot; action=&quot;{{ url('\/logout') }}&quot; method=&quot;POST&quot; style=&quot;display: none;&quot;&gt;         {{ csrf_field() }}       &lt;\/form&gt;        @endif       &lt;\/ul&gt;     &lt;\/div&gt;      &lt;div class=&quot;navbar-end&quot;&gt;       &lt;!-- navbar items --&gt;     &lt;\/div&gt;   &lt;\/div&gt; &lt;\/nav&gt;  <\/code><\/pre>\n<p>  <\/p>\n<h3>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 <\/h3>\n<p>  \u041f\u043e\u0440\u0430 \u0443\u0436\u0435 \u0438 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u043e\u0442\u043e\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u043e\u0436\u0435\u0442 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u044f \u0445\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0431\u044b\u043b \u043e\u0434\u0438\u043d \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 (\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043f\u0440\u043e\u0434\u0436\u0435\u043a\u0442-\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438, \u0438 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u044d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0438\u0434\u0435\u0442\u044c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043a\u0442\u043e-\u0442\u043e \u043c\u043e\u0433 \u0431\u0440\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0442\u043e\u043c.<\/p>\n<p>  \u041e\u043a\u0435\u0439, \u0437\u043d\u0430\u0447\u0438\u0442 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0434\u0432\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u044e\u0437\u0435\u0440\u043e\u0432 \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430\u0448\u0443 \u0434\u043e\u0441\u043a\u0443 \u0437\u0430\u0434\u0430\u0447 \u0441\u043c\u043e\u0433\u0443\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u044e\u0437\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u0430\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f, \u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0443\u043f\u0435\u0440\u0430\u0434\u043c\u0438\u043d\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u044f \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0432\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b: \u043e\u0434\u043d\u0443, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u0435\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u0432\u0442\u043e\u0440\u0443\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0443\u043f\u0435\u0440\u0430\u0434\u043c\u0438\u043d\u0443. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u0437\u0432\u0430\u0442\u044c <code>welcome.blade.php<\/code>:<\/p>\n<pre><code class=\"php\">@include('includes.header')  &lt;body&gt;     @include('includes.nav')     &lt;div class=&quot;columns is-centered&quot;&gt;         &lt;div class=&quot;column is-half&quot;&gt;             &lt;div class=&quot;panel&quot;&gt;                 &lt;div class=&quot;panel-heading&quot;&gt;                     \u0422\u0435\u043a\u0443\u0449\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438                 &lt;\/div&gt;                  &lt;div class=&quot;panel-body&quot;&gt;                     @foreach ($tasks as $task)                     &lt;a class=&quot;panel-block&quot;&gt;                         &lt;button class=&quot;button is-rounded&quot;&gt;                             &lt;span&gt;{{ $task-&gt;name }}&lt;\/span&gt;                         &lt;\/button&gt;                         @endforeach                 &lt;\/div&gt;             &lt;\/div&gt;         &lt;\/div&gt;     &lt;\/div&gt; &lt;body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447. \u0414\u043b\u044f \u0435\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u043d\u043e\u0432\u044b\u0439 \u043f\u0443\u0442\u044c \u0432 web.php:<\/p>\n<pre><code class=\"php\">Route::get('\/', function () {     return view('welcome', [         'tasks' =&gt; Task::orderBy('created_at', 'asc')-&gt;get(),     ]); }); <\/code><\/pre>\n<p>  \u0428\u0430\u0431\u043b\u043e\u043d, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443 \u043d\u0430\u0441 \u0442\u043e\u0442 \u0436\u0435 \u0441\u043f\u0438\u0441\u043e\u043a, \u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>task.blade.php<\/code>. \u041e\u043d \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0432\u0435\u043b\u0438\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0443 \u0435\u0433\u043e \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">task.blade.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">@extends('layouts.app')  @section('content') &lt;div class=&quot;columns is-centered&quot;&gt;     &lt;div class=&quot;column is-half&quot;&gt;         &lt;div class=&quot;panel&quot;&gt;             &lt;div class=&quot;panel-heading&quot;&gt;                 \u041d\u043e\u0432\u043e\u0435 \u0434\u0435\u043b\u043e             &lt;\/div&gt;             &lt;div class=&quot;panel-block&quot;&gt;                 @include('common.errors')                 &lt;!-- \u0424\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0441\u043a\u043e\u0432 --&gt;                 &lt;form action=&quot;{{ url('task')}}&quot; method=&quot;POST&quot;&gt;                     {{ csrf_field() }}                      &lt;div class=&quot;field&quot;&gt;                         &lt;label for=&quot;task-name&quot; class=&quot;label is-medium&quot;&gt;\u0414\u0435\u043b\u043e&lt;\/label&gt;                         &lt;input type=&quot; text&quot; name=&quot;name&quot; id=&quot;task-name&quot; class=&quot;input is-medium&quot;                             value=&quot;{{ old('task') }}&quot;&gt;                     &lt;\/div&gt;                      &lt;div class=&quot;field&quot;&gt;                         &lt;button type=&quot;submit&quot; class=&quot;button is-success&quot;&gt;                             &lt;span class=&quot;icon&quot;&gt;                                 &lt;i class=&quot;fa fa-btn fa-plus&quot;&gt;                             &lt;\/span&gt;&lt;\/i&gt;                             &lt;span&gt;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u043b\u043e&lt;\/span&gt;                         &lt;\/button&gt;                     &lt;\/div&gt;                 &lt;\/form&gt;             &lt;\/div&gt;         &lt;\/div&gt;          &lt;!-- Current Tasks --&gt;         @if (count($tasks) &gt; 0)         &lt;div class=&quot;panel&quot;&gt;             &lt;div class=&quot;panel-heading&quot;&gt;                 \u0422\u0435\u043a\u0443\u0449\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438             &lt;\/div&gt;              &lt;div class=&quot;panel-body&quot;&gt;                 {{-- &lt;table class=&quot;table table-striped task-table&quot;&gt;                     &lt;thead&gt;                         &lt;th&gt;\u0414\u0435\u043b\u043e&lt;\/th&gt;                         &lt;th&gt;&nbsp;&lt;\/th&gt;                     &lt;\/thead&gt;                     &lt;tbody&gt; --}}                 @foreach ($tasks as $task)                 &lt;a class=&quot;panel-block&quot;&gt;                     &lt;button class=&quot;button is-rounded&quot;&gt;                     &lt;span&gt;{{ $task-&gt;name }}&lt;\/span&gt;                 &lt;\/button&gt;                     &lt;form action=&quot;{{ url('task\/'.$task-&gt;id) }}&quot; method=&quot;POST&quot;&gt;                         {{ csrf_field() }}                         {{ method_field('DELETE') }}                         &lt;button type=&quot;submit&quot; class=&quot;button is-danger&quot;&gt;                             &lt;span class=&quot;icon is-small&quot;&gt; &lt;i class=&quot;fa fa-btn fa-trash&quot;&gt;&lt;\/i&gt;&lt;\/span&gt;                             &lt;span&gt; \u0423\u0434\u0430\u043b\u0438\u0442\u044c &lt;\/span&gt;                         &lt;\/button&gt;                     &lt;\/form&gt;                 &lt;\/a&gt;                 @endforeach             &lt;\/div&gt;         &lt;\/div&gt;         @endif     &lt;\/div&gt; &lt;\/div&gt; @endsection  <\/code><\/pre>\n<p>   <\/div>\n<\/div>\n<p>  \u0418 \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d, \u043a\u0430\u043a \u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f \u0432 <code>app\/layouts.blade.php<\/code>:<\/p>\n<pre><code class=\"php\">@include('includes.header')  &lt;body&gt;     @include('includes.nav')      @yield('content')  &lt;\/body&gt;  &lt;\/html&gt; <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0421 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0432\u0438\u0434\u043e\u043c \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u0443 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u0430\u0448\u0438\u0445 <code>middlewares<\/code>.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0439\u0434\u0435\u043c \u0432 \u043c\u043e\u0434\u0435\u043b\u044c <i>Users<\/i> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code class=\"php\">const ADMIN_TYPE = 'admin'; const TEAM_TYPE = 'team'; #\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u043d\u0435\u0446 \u043a\u043b\u0430\u0441\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:  public function isAdmin(){             return $this-&gt;type === self::ADMIN_TYPE;     \/\/ \u0442\u0440\u0435\u0431\u0443\u0435\u043c \u0434\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0442\u0438\u043f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f     } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u044b users (\u043f\u0430\u043f\u043a\u0430 database\/migrations) \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 \u0441 \u043d\u0430\u0448\u0438\u043c \u043d\u043e\u0432\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"plaintext\">$table-&gt;string('type')-&gt;default('team'); \/\/ \u043f\u043e\u043a\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u043a\u0440\u043e\u043c\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0443 \u043d\u0430\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u043e\u0433\u043e \u043d\u0435\u0442\u0443 <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0432 <code>app\/Http\/Controllers\/Auth\/RegisterController.php<\/code> \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e create (\u043e\u043d\u0430 \u0442\u043e\u0436\u0435 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 5 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443):<\/p>\n<pre><code class=\"php\">protected function create(array $data)     {         return User::create([             'name' =&gt; $data['name'],             'email' =&gt; $data['email'],             'password' =&gt; Hash::make($data['password']),             'type' =&gt; User::TEAM_TYPE,           ]);     }  <\/code><\/pre>\n<p>  \u041e\u043a\u0435\u0439, \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0448\u0443 middleware \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u0430. \u041f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"plaintext\">php artisan make:middleware IsAdmin <\/code><\/pre>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0443 \u0432\u0430\u0441 \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u0412 \u043f\u0430\u043f\u043a\u0435 <code>HTTP\/middleware<\/code> \u0443 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f <code>isAdmin.php<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044e handle \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"plaintext\">public function handle($request, Closure $next)     {         if(auth()-&gt;user()-&gt;isAdmin()) {             return $next($request);         \/\/ \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0430, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 - \u0442\u043e\u0433\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043e\u043c\u043e\u0439     }         return redirect('\/');     } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 <i>middleware<\/i> \u0432 <code>app\/HTTP\/Kernel<\/code>, \u0447\u0442\u043e\u0431\u044b \u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f:<\/p>\n<pre><code class=\"plaintext\">protected $routeMiddleware = [     #\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0438\u0434\u043b\u0435\u0432\u0435\u0438\u0440\u043e\u0432, \u043d\u0435 \u0442\u0430\u043a \u0432\u0430\u0436\u043d\u044b\u0445 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438         is_admin' =&gt; \\App\\Http\\Middleware\\IsAdmin::class, ]; <\/code><\/pre>\n<p>  \u0422\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u0443\u0442\u044c <i>dash<\/i> \u0432 <code>web.php<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0443\u043f\u0435\u0440\u0430\u0434\u043c\u0438\u043d:<\/p>\n<pre><code class=\"php\">Route::get('\/dash', function () {     return view('tasks', [         'tasks' =&gt; Task::orderBy('created_at', 'asc')-&gt;get(),     ]);  }) -&gt;middleware('is_admin')     -&gt;name('admin');  # \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f  Auth::routes(); Route::post('\/logout', 'Auth\\LoginController@logout')-&gt;name('logout'); <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u0440 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"plaintext\">php artisan make:controller AdminController <\/code><\/pre>\n<p>  \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre><code class=\"plaintext\">public function __construct()     {         $this-&gt;middleware('auth');     }     public function admin()     {         return view('admin');     }  <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443 \u0432\u0430\u0441 \u0432\u0441\u0435 \u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e, \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0432 <code>RouteServiceProvider.php<\/code> \u0432 <code>app\/HTTP\/Providers<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u043e\u043d \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430 \u0448\u0430\u0431\u043b\u043e\u043d home:<\/p>\n<pre><code class=\"php\">public const HOME = '\/'; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0443 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 tinker: <\/p>\n<pre><code class=\"plaintext\">php artisan tinker use App\\User; User::where('email', 'admin@mail.com')-&gt;update(['type' =&gt; 'admin']); \/\/\u0434\u0430\u0435\u043c \u043d\u0430\u0448\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0430\u0432\u0430 \u0430\u0434\u043c\u0438\u043d\u0430 <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0432\u0442\u043e\u0440\u044e <a href=\"https:\/\/github.com\/isakura313\/laravel_todo\/tree\/new\"> \u0441\u0441\u044b\u043b\u043a\u0443<\/a> \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0430\u0448\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439, \u043a\u0442\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0435. \u041d\u043e \u043a\u0430\u043a \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f? <\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u043e\u0447\u0442\u0430, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043e\u043a \u0432 \u0432\u0430\u043b\u0438\u0434\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0447\u0442\u044b. \u0418\u043b\u0438 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0430\u0434\u043c\u0438\u043d\u0430, \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0432 \u0441\u0445\u043e\u0436\u0438\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438. \u041f\u043e \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0441\u0441\u044b\u043b\u043e\u043a, \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0430\u0442\u044c \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c Laravel:<\/p>\n<p>  \u2192 <a href=\"https:\/\/www.sitepoint.com\/laravel-migrations\/\"> \u0427\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u0447\u0435\u043c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u0445 \u0432 Laravel<\/a><br \/>  \u2192 <a href=\"https:\/\/medium.com\/@tomgrohl\/implementing-user-roles-into-a-laravel-application-f8b9b5c266a7\"> \u041d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 Medium \u043f\u0440\u043e \u0440\u043e\u043b\u0438 \u0432 Laravel<\/a><br \/>  \u2192 <a href=\"https:\/\/laravel.demiart.ru\/laravel-7-whats-new\/\"> \u0427\u0442\u043e \u0443 \u043d\u0430\u0441 \u0441\u0432\u0435\u0436\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u0432 Laravel 7<\/a><\/p>\n<hr>\n<p>  <b><a href=\"https:\/\/otus.pw\/bz5Y\/\">\u0420\u0430\u0437\u0432\u043e\u0440\u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u00ab\u0431\u0435\u0437 \u0431\u043e\u043b\u0438\u00bb \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Forge\/Envoyer.<br \/>  <\/a><\/b>  <\/p>\n<hr>\n<\/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=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/497506\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/497506\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/497506\/\"><i><b>\u0421\u0430\u043b\u044e\u0442, \u0445\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0437\u0432\u0430\u043d\u0438\u0435 \u0445\u0430\u0440\u0434\u043a\u043e\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u043c \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u0430. \u0416\u0434\u0435\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0432\u0430\u0448\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0442\u0430\u0442\u044c\u0435, \u0430 \u0437\u0430 \u0431\u043e\u043b\u0435\u0435 \u0445\u0430\u0440\u0434\u043a\u043e\u0440\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u043d\u0430\u0448 \u043a\u0443\u0440\u0441 <a href=\"https:\/\/otus.pw\/bz5Y\/\">\u00abFramework Laravel\u00bb<\/a>. <\/b><\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0k\/zr\/tc\/0kzrtcgvl777bqznfbpicgqsepc.png\">  <\/p>\n<hr>\n<p>   \u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0421\u0435\u0433\u043e\u0434\u043d\u044f, \u0432 \u0441\u0442\u043e\u043b\u044c \u00ab\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0435\u00bb \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e\u0439 todo, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u0430\u0434\u0430\u0447\u0438. \u0417\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Laravel, \u0438 \u0442\u0430\u043a \u043e\u043d\u043e \u0438 \u0435\u0441\u0442\u044c \u2014 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0438\u0445 todo \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u044b, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0435\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e, \u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0435\u0433\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0438 <strike>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043d\u0435\u043b\u0435\u043f\u044b\u0439 \u043a\u043b\u043e\u043d Trello<\/strike>.   <\/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-302013","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302013","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=302013"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302013\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302013"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302013"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}