{"id":1310,"date":"2023-11-27T10:31:46","date_gmt":"2023-11-27T10:31:46","guid":{"rendered":"https:\/\/www.devopssupport.in\/blog\/?p=1310"},"modified":"2023-11-29T10:52:11","modified_gmt":"2023-11-29T10:52:11","slug":"resolving-fatalerror-trait-illuminatefoundationauthauthenticatesusers-not-found","status":"publish","type":"post","link":"https:\/\/www.devopssupport.in\/blog\/resolving-fatalerror-trait-illuminatefoundationauthauthenticatesusers-not-found\/","title":{"rendered":"Resolving FatalError: Trait &#8220;Illuminate\\Foundation\\Auth\\AuthenticatesUsers&#8221; not found"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"335\" src=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/11\/image-36-1024x335.png\" alt=\"\" class=\"wp-image-1311\" srcset=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/11\/image-36-1024x335.png 1024w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/11\/image-36-300x98.png 300w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/11\/image-36-768x251.png 768w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/11\/image-36-1536x503.png 1536w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/11\/image-36-850x278.png 850w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/11\/image-36.png 1635w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If you&#8217;ve encountered the FatalError with the message &#8220;Trait &#8216;Illuminate\\Foundation\\Auth\\AuthenticatesUsers&#8217; not found&#8221; in your Laravel application, don&#8217;t worry. we&#8217;ll explore the issue and provide you with a step-by-step solution to resolve the error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding the Issue<\/h2>\n\n\n\n<p>The error indicates that the <code>Illuminate\\Foundation\\Auth\\AuthenticatesUsers<\/code> trait, which is used in the <code>AdminLoginController<\/code>, cannot be found. This trait is responsible for handling user authentication functionality in Laravel applications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Error Context<\/h2>\n\n\n\n<p>Here&#8217;s a snippet of the code where the error is occurring:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use Illuminate\\Foundation\\Auth\\AuthenticatesUsers;\r\n\r\nclass AdminLoginController extends Controller\r\n{\r\n    use AuthenticatesUsers;\r\n\r\n    \/\/ Other code...\r\n}\r\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Solution: Adding the Missing Trait<\/h2>\n\n\n\n<p>To resolve this issue, you need to ensure that the <code>AuthenticatesUsers<\/code> trait is available. Starting from Laravel 7, the <code>AuthenticatesUsers<\/code> trait is part of the <code>laravel\/ui<\/code> package. If you&#8217;ve recently upgraded your Laravel version, you might need to update your dependencies.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Steps to Resolve<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open your <code>composer.json<\/code> file.<\/li>\n\n\n\n<li>Add or update the version of <code>laravel\/ui<\/code> in the <code>require<\/code> section:<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"require\": {\r\n    \"php\": \"^8.1\",\r\n    \"laravel\/ui\": \"^4.2\",\r\n    \/\/ ... other dependencies\r\n}\r\n<\/code><\/pre>\n\n\n\n<p>or run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>composer require laravel\/ui \"^4.2\"\r\n<\/code><\/pre>\n\n\n\n<p>Run the Composer update command to apply the changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>composer update\r\n<\/code><\/pre>\n\n\n\n<p>By ensuring that the <code>laravel\/ui<\/code> package is at the correct version, you resolve the issue of the missing <code>AuthenticatesUsers<\/code> trait. Remember to keep your dependencies up to date, especially when upgrading Laravel versions, to benefit from the latest features and bug fixes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve encountered the FatalError with the message &#8220;Trait &#8216;Illuminate\\Foundation\\Auth\\AuthenticatesUsers&#8217; not found&#8221; in your Laravel application, don&#8217;t worry. we&#8217;ll explore the issue and provide you with a&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[553,56,552],"class_list":["post-1310","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-authenticatesuser","tag-not-found","tag-resolving-fatalerror-trait-illuminatefoundationauthauthenticatesusers"],"_links":{"self":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/1310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/comments?post=1310"}],"version-history":[{"count":1,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/1310\/revisions"}],"predecessor-version":[{"id":1312,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/1310\/revisions\/1312"}],"wp:attachment":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/media?parent=1310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/categories?post=1310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/tags?post=1310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}