Comments (11)
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.
And this cms using laravel 5.5 is being released so don't worry :)
from laravel-9-simple-cms.
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.
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.
Glad that it worked :)
Closing this.
from laravel-9-simple-cms.
@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.
@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.
@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.
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.
@ozdemirburak But you do know that asset() returns "http://simplecms.local/public" ?
from laravel-9-simple-cms.
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)
- Unable to deploy code to cpanel subfolder HOT 1
- Unable to change data table width HOT 1
- The Mix manifest does not exist. HOT 1
- Collisions with other trait methods on App\Base\SluggableModel HOT 2
- Possible password reset issue. HOT 2
- Sluggable model issue for UTF-8 HOT 1
- Sluggable HOT 4
- Upgrade to Laravel 9 HOT 5
- Add Screenshots to README.md
- On Click show button from table in Admin returning Json Data HOT 3
- Composer Install issue HOT 1
- Composer install issue for version 8.2 HOT 1
- Categories NOT DISPLAY - SHOW WARNING HOT 3
- Any support for uuid? HOT 1
- How to upload images in articles? HOT 3
- Order articles in admin HOT 1
- Working on routing with custom url HOT 1
- new post type HOT 3
- ViewException in homepage HOT 1
- Exception: String could not be parsed as XML
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-9-simple-cms.