Issue with locating css and js files in Laravel 6 (net::ERR_ABORTED 404 (Not Found))

While everything works fine when I use the Laravel development server (php artisan serve), I encounter a 404 error when attempting to use XAMPP server for the Laravel auth login and register pages.

I typically use

href="{{ asset('css/app.css') }}"

Accessing 127.0.0.1:8000/login functions properly:

However, if I try to access it through XAMPP server like blog.test/login, it does not work:

Answer №1

For Laravel 6 and later versions, it is necessary to install the UI package. Execute the following commands in the Artisan console:

composer require laravel/ui --dev

php artisan ui bootstrap

php artisan ui bootstrap --auth

npm install 

npm run dev

Answer №2

It appears that there may be an issue with the way your css file link is written.

To ensure proper linking, consider using

<a href = "{{asset('//your public path location')}}" />

Answer №3

Helpful Tip:

{{includeCss('assets_file.css')}}

Answer №4

Run the command php artisan sweetalert:publish to publish SweetAlert.

Answer №5

Ensure that your path and folder are located correctly. Verify the existence of css and js files in the specified location. If you have configured a public folder, make sure that the root in the index.php file is as follows:

$app = require_once __DIR__.'/../bootstrap/app.php';

If you have not set up a public folder, check if the files exist in the root directory using the following configuration:

$app = require_once __DIR__.'/bootstrap/app.php';

Confirm that your files (including css and js files) are placed in the correct directory and not just in the public folder. Additionally, ensure that the files have been physically uploaded.

We hope these steps resolve your issue!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Alter the configuration of a JSON object

I'm currently working on modifying the following JSON text. It has the structure as shown below: { "cabecera": { "tipo_cambio": "", "fecha_emision": "", "total": "" }, "detalle": { "940b130369614bd6b687dc5b41623439": { " ...

An effective method for converting MongoDB's JSON array of UTC dates to local time using Node.js

Using Node.js to query MongoDB and encountering an issue with Date (ISODate) fields. After querying, the Date format returned is as follows: DT : 2014-10-02T02:36:23.354Z The goal is to efficiently convert the DT field from UTC to Local Time ISOString. F ...

Uncover the solution to eliminating webpack warnings associated with incorporating the winston logger by utilizing the ContextReplacementPlugin

When running webpack on a project that includes the winston package, several warnings are generated. This is because webpack automatically includes non-javascript files due to a lazy-loading mechanism in a dependency called logform. The issue arises when ...

Some packages seem to be missing in React Native

I decided to incorporate a project I cloned from GitHub into my React Native app by placing it in a separate folder outside of the app. After running npm link on the project and linking it to my own project, I encountered an issue when attempting to run i ...

Utilizing object categories to split arrays and extract values in JavaScript with Highcharts

After receiving an array with a number of objects, my goal is to split it based on categories. Once the sum value of categories in the array reaches 15, I need to further divide the array as shown below for better organization. Any assistance would be gre ...

Sending a jsp page for review at specified intervals

Using the setTimeout method, I attempted to achieve this. I passed a variable containing time as an argument, but the setTimeout method is only taking the initialized value of that variable and not the updated value fetched from the database. Below is the ...

Is it possible to utilize the ternary operator to handle classnames when working with CSS modules?

I am experiencing difficulty implementing a styling feature using the ternary operator within an element's className. My goal is to have three buttons that render a specific component when clicked. Additionally, I want to change the background color ...

Tips on incorporating the vue package

I recently started using Vue and decided to incorporate a plugin called vue-toastr. I'm attempting to integrate it with Laravel, which already has Vue set up with the plugin. Unfortunately, I keep encountering an error that says "TypeError: Cannot rea ...

How come (23 == true) is incorrect but (!!23 == true) is correct? After all, there is === for exact comparisons

The question boils down to this: are both 23 and true truthy values? If so, shouldn't they be equal under the loose comparison operator ==? However, there is also the strict comparison operator === for cases where precise equality is required. UPDATE ...

Develop a JavaScript application that contains a collection of strings, and efficiently sorts them with a time complexity of O(nlog n)

Seeking assistance in developing a JavaScript program that contains an array of strings and must sort them efficiently in O(nlog n) time. Grateful for any guidance... ...

The page is failing to load the style.css file, resulting in an

Within my project directory, I have the following files: style.css located in the Content folder, as well as image.jpg found in the Images folder. https://i.sstatic.net/IKArS.jpg The default page is Login.aspx. <%@ Page Language="C#" Aut ...

What is the best way to align two elements side by side using flexbox?

After trying to find a solution on this site without success, I realized that my situation is quite unique. I need to avoid changing the HTML code, minimize the use of classes, and refrain from using IDs. The current HTML structure I am working with inclu ...

Sending data from an external input field to a form using AngularJS programmatically with element name

I am facing a challenge where I need to include an Input element in a Form, even though the Input is located outside of the form. While I have managed to add the input using form.$addControl(outerInput), it is not producing the desired outcome as shown in ...

I am experiencing difficulty with the Click() operation in Selenium web driver as it is not successfully redirecting me to another page

Hello everyone, I could really use your assistance with a problem I'm facing. WebElement wb=driver.findElement(By.name("NavHeader1$tabs$ctl00$btnNavHeaderTab")); Actions act=new Actions(driver); act.moveToElement(wb).perform(); ...

Vue.js does not display HTML properly within the vue-swal component

I'm currently working on integrating HTML content into a Sweet Alert popup using this code snippet Link: https://www.npmjs.com/package/vue-swal this.$swal({ title: '<i>Custom HTML</i>', html:`This is an <em> em ...

What is the best way to ensure that the child element of a Material UI TableCell Component occupies the full height of the cell?

I am currently using MUI version 5 to create a table. In this table, there are two columns with cells that contain multiline TextFields. My goal is to have the TextFields completely fill the cell area. However, I am encountering an issue where when I start ...

Displaying data on the number of vertices and triangles in the editor interface

Can anyone provide guidance on how to incorporate a legend displaying the number of Vertices and Triangles, as well as a 3 axes helper legend, in Three.js rendering within the example editor? I have attached a screenshot of the scene with these legends for ...

Best practices for updating the value of a specific key within an object that contains recursion in JavaScript/TypeScript

I have a tree component that uses the following data structure type TreeNode = { id: string, parentId: string, renderer: () => React.ReactNode, expanded: boolean, children?: Array<TreeNode>, } Now, I am looking to add functionality for ...

Dealing with illegal characters, such as the notorious £ symbol, in JSON data within a JQuery

I'm encountering an issue with a textarea and the handling of special symbols. Specifically, when I use $('#mytextarea').val() to retrieve text that contains '£', I end up seeing the black diamond with a question mark inside it. T ...

Unforeseen issue with the top attribute in a Bootstrap card-group

I encountered an unexpected issue within a bootstrap card group. Here's what I observed: https://i.sstatic.net/jo8WO.png Upon inspection, I noticed that the third card's image does not align with the top value of the other cards, despite shari ...