Giter Site home page Giter Site logo

Comments (11)

shirshak55 avatar shirshak55 commented on July 19, 2024 2

first is your path to asset correct? mix uses mix.manifest which is used to determine true path of file.

from laravel-9-simple-cms.

shirshak55 avatar shirshak55 commented on July 19, 2024 1

And this cms using laravel 5.5 is being released so don't worry :)

from laravel-9-simple-cms.

ozdemirburak avatar ozdemirburak commented on July 19, 2024 1

First, your mix script may be outdated, try to run npm update first.

Then, check your mix-manifest.json file after running npm run dev or npm run production.

If you run it for production, then you will get something like below, where asterisks are unique hashes generated by mix.

{
    "/dist/js/application.js": "/dist/js/application.js?id=*********************",
    "/dist/css/admin.css": "/dist/css/admin.css?id=*********************",
    "/dist/css/application.css": "/dist/css/application.css?id=*********************",
    "/dist/js/admin.js": "/dist/js/admin.js?id=*********************"
}

So when you call mix function, what it just does is, it maps the asset files. For instance if you call mix('/dist/js/application.js'), it will return /dist/js/application.js?id=********************* which is the corresponding value of /dist/js/application.js defined in the mix file.

Maybe you may want to wrap that mix call with an asset function, like asset(mix('/dist/js/application.js')), which will produce something like http://localhost:8000/dist/js/application.js?id=*********************.

from laravel-9-simple-cms.

ozdemirburak avatar ozdemirburak commented on July 19, 2024 1

It's because of your server's root directory is the project's root directory. Public directory should be the one where your project is being served.

project  <--- this is where your server's root now
    public

project
    public  <--- this should be the root of your server.

Change your xamp/mamp configuration or whatever enviroment you are using.

If you are using xamp, change your root like something below. You can check this SO question for further information.

DocumentRoot "C:/xampp/htdocs/cms/public"

from laravel-9-simple-cms.

ozdemirburak avatar ozdemirburak commented on July 19, 2024 1

Glad that it worked :)

Closing this.

from laravel-9-simple-cms.

kd-s-t avatar kd-s-t commented on July 19, 2024

@bloggervista yes correct not having issues anymore. But I would still want to use mix() maybe it uses different functions like you mention .manifest.

from laravel-9-simple-cms.

kd-s-t avatar kd-s-t commented on July 19, 2024

@ozdemirburak yes already did that since I am following the instructions. or maybe there was an error running it. let me check it out again.

from laravel-9-simple-cms.

kd-s-t avatar kd-s-t commented on July 19, 2024

@ozdemirburak no need to wrap it up in asset(mix('/dist/js/application.js')). the only error in mix() is its missing "public/" in the path. while asset() returns with "public/dist/" path.

from laravel-9-simple-cms.

ozdemirburak avatar ozdemirburak commented on July 19, 2024

Public should not be in the url, check your server configuration as the public is the root directory where application is being served.

from laravel-9-simple-cms.

kd-s-t avatar kd-s-t commented on July 19, 2024

@ozdemirburak But you do know that asset() returns "http://simplecms.local/public" ?

from laravel-9-simple-cms.

kd-s-t avatar kd-s-t commented on July 19, 2024

Working on MAMP. I pointed it on public folder. You were right all along. Why didn't you say so haha THanks! @ozdemirburak

from laravel-9-simple-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.