How To Compile Assets In Laravel | Laravel For Beginners | Learn Laravel

  Рет қаралды 28,838

Code With Dary

Code With Dary

Күн бұрын

This video will show the how to compile your JavaScript and CSS in Laravel - Learn one of the most popular PHP frameworks for its advanced features, templating engine, fast commands and security.
📚 New Udemy Course
If you're looking to level up your Laravel skills, my new course "Udemy Migirations, Seeders, Factories, Query Builder, Eloquent & Relationships" is the perfect opportunity. Learn the essential tools and techniques for building robust and scalable web applications with Laravel: www.udemy.com/...
📲 Let’s plan a meeting
Plan a (paid) 1-hour meeting on Calendly to do portfolio reviews, code reviews resume reviews or a coaching session for Laravel. Please read the description before booking: calendly.com/c...
💌 Newsletter
Sign up for my free weekly email newsletter: www.newsletter...
🔥 Resources
- PHP Hosting (10% DISCOUNT): www.hostinger....
- TikTok: / codewithdary
- Instagram: / codewithdary
- Twitter: / codewithdary
- Blog: blog.codewithd...
- Newsletter: newsletter.cod...
- Patreon: www.patreon.co...
- GitHub: github.com/cod...
Want to learn more?
- Courses: / @codewithdary
#laravel #laravel8 #php #assets #javascript #css

Пікірлер: 57
@codewithdary
@codewithdary 3 жыл бұрын
I want to start using my socials a bit more, if you’re interested, give me a follow op Instagram!  instagram.com/darynazar/
@ProgrammingNusantara
@ProgrammingNusantara 2 жыл бұрын
Thank u sir, u save my work!
@codewithdary
@codewithdary 2 жыл бұрын
Happy to help man :)
@Alireza-bj6dv
@Alireza-bj6dv 2 жыл бұрын
Perfect
@codewithdary
@codewithdary 2 жыл бұрын
Thank you :)
@eloquent2200
@eloquent2200 2 жыл бұрын
Thank you!
@codewithdary
@codewithdary 2 жыл бұрын
You're welcome!
@tallitvak5325
@tallitvak5325 3 жыл бұрын
the best of the best!
@codewithdary
@codewithdary 3 жыл бұрын
I have the best viewers :D
@hasnainabidkhanzada3754
@hasnainabidkhanzada3754 2 жыл бұрын
Why use mix? What if i create the css and js files in public directory instead of compiling them?
@mibrahim4245
@mibrahim4245 2 жыл бұрын
Thank you Dary 🌹 .. So what was the original need for mix and vite and webpack in general? Is it only to compile the files like scss to css, to make codes compatible with all browsers, and to minify them? Is that all?
@codewithdary
@codewithdary 2 жыл бұрын
Pretty much yes. Most people forget that its just to compile frontend assets, nothing more than that...
@mibrahim4245
@mibrahim4245 2 жыл бұрын
@@codewithdary 🌹🙏
@walebee4668
@walebee4668 2 жыл бұрын
hi, do i need to run laravel mix when i making a changes to my js files on the Cpanel server ?
@codewithdary
@codewithdary 2 жыл бұрын
Yes it does needs to be recompiled :)
@rajabhishek2936
@rajabhishek2936 3 жыл бұрын
Amezing.....
@technoking536
@technoking536 Жыл бұрын
This is good stuff👍
@codewithdary
@codewithdary Жыл бұрын
Thank you!
@muniraakter2103
@muniraakter2103 2 жыл бұрын
Thanks a lot, sir, Just awesome as well.
@codewithdary
@codewithdary 2 жыл бұрын
Most welcome Munira! :)
@paulbrugger9610
@paulbrugger9610 2 жыл бұрын
on the final npm run dev (after the tailwindcss stuff) I get: 'mix' is not recognized as an internal or external command, operable program or batch file. and the css is not working (formerly was) any ideas?
@fabzster187
@fabzster187 2 жыл бұрын
The assets are compiled allm in the js directory. I have /public/js/app.js and /public/js/app.css, it does not create the app/css directory. cant understand why
@codewithdary
@codewithdary 2 жыл бұрын
Can you show me your webpack file?
@fabzster187
@fabzster187 2 жыл бұрын
@@codewithdary many thanks for the reply, const mix = require('laravel-mix'); mix.js('resources/js/app.js', 'public/js') .sass('resources/sass/app.scss', 'public/css'); what is quite weird is, if I try to compile the sass alone mix.sass('resources/sass/app.scss', 'public/css'); it compiles mix.css . The files compile, but just the css is in the js folder
@visualdad9453
@visualdad9453 3 жыл бұрын
thank you dary :]
@codewithdary
@codewithdary 3 жыл бұрын
Thank you for watching :)
@terryrocker8681
@terryrocker8681 3 жыл бұрын
When you install tailwind after installing sass, sass doesn't work. any thoughts Dary?
@codewithdary
@codewithdary 3 жыл бұрын
Aren't you compiling the files with the same name? Then it will overwrite :)
@asharmuhammad8686
@asharmuhammad8686 3 жыл бұрын
because you are overwriting the app.css, change the scss filename...
@mouctechy
@mouctechy 2 жыл бұрын
Thanks bro
@codewithdary
@codewithdary 2 жыл бұрын
Any time!
@djamilsellam931
@djamilsellam931 3 жыл бұрын
run watch and poll-watch are not working for me !
@codewithdary
@codewithdary 3 жыл бұрын
Sharing the error message allows others to help you.
@adriantolero6687
@adriantolero6687 2 жыл бұрын
Hello sir Dary, I have an error after entering this line command "npm install && npm run dev" which causes this error "'mix' is not recognized as an internal or external command, operable program or batch file."
@codewithdary
@codewithdary 2 жыл бұрын
Likely you need to install the latest version of Laravel Mix. npm install laravel-mix@latest --save-dev
@teragigamega5183
@teragigamega5183 3 жыл бұрын
composer require laravel-frontend-presets/tailwindcss --dev ✔ npm instal tailwindcss ✔ npm install and npm run dev ✖ 'mix' is not recognized as an internal or external command, operable program or batch file. Why is this happening? Thank you for your response. node v15.5.0 npm 7.3.0 Laravel Framework 8.22.1 Windows10 64bit
@teragigamega5183
@teragigamega5183 3 жыл бұрын
I think I solved the problem. Thanks anyway
@temdenis4109
@temdenis4109 3 жыл бұрын
Good evening sir, please how did you solve this problem? Am facing the same problem. Please help me out sir.
@teragigamega5183
@teragigamega5183 3 жыл бұрын
@@temdenis4109 Apologize, I m seeing your message now. Give me some time to get home and remind myself, hope I will help you soon.
@temdenis4109
@temdenis4109 3 жыл бұрын
@@teragigamega5183 thank you very much sir , am waiting to hearing from you, please my friend is also trying to install tailwind CSS but it's not installing, do you have any idea?
@Kejnjrbdbfhhrbb
@Kejnjrbdbfhhrbb 3 жыл бұрын
JUST RUN THIS npm install laravel-mix@latest --save-dev
@PunLlarena
@PunLlarena 2 жыл бұрын
Installing tailwind using composer doesn't work on Laravel 9. And this topic isn't covered in the Laravel 9 Course yet. Your requirements could not be resolved to an installable set of packages. Problem 1 - laravel-frontend-presets/tailwindcss[4.3.0, ..., 4.3.1] require laravel/framework ^8.0 -> found laravel/framework[v8.0.0, ..., 8.x-dev] but it conflicts with your root composer.json require (^9.2). - Root composer.json requires laravel-frontend-presets/tailwindcss ^4.3 -> satisfiable by laravel-frontend-presets/tailwindcss[4.3.0, 4.3.1]. Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions. You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel-frontend-presets/tailwindcss:*" to figure out if any version is installable, or "composer require laravel-frontend-presets/tailwindcss:^2.1" if you know which you need. Installation failed, reverting ./composer.json and ./composer.lock to their original content.
@codewithdary
@codewithdary 2 жыл бұрын
Tailwind has its own documentation on how you should add TailwindCSS into an Laravel project: tailwindcss.com/docs/guides/laravel
@PunLlarena
@PunLlarena 2 жыл бұрын
Yep, I checked on their documentation and had it working. Thanks for checking on my comment.
@santhoshkumar4783
@santhoshkumar4783 3 жыл бұрын
Where is the link that u mentioned in the video to download node js?
@codewithdary
@codewithdary 3 жыл бұрын
Your so right! My bad, the link is here: nodejs.org/en/download/
@shye351
@shye351 3 жыл бұрын
background url doesnt work, image wont show
@codewithdary
@codewithdary 3 жыл бұрын
You might need to clear your cache
@Konstantinosiakovou
@Konstantinosiakovou 3 жыл бұрын
I can not understand why it does not work for me. I follow your steps.
@codewithdary
@codewithdary 3 жыл бұрын
What's going wrong? :)
@Konstantinosiakovou
@Konstantinosiakovou 3 жыл бұрын
@@codewithdary thank you for answer me. The background color does not change.
@codewithdary
@codewithdary 3 жыл бұрын
Has the app.css file even been compiled?
@Konstantinosiakovou
@Konstantinosiakovou 3 жыл бұрын
@@codewithdary run successfully.
Databases & Migrations | Laravel For Beginners | Learn Laravel
15:09
Code With Dary
Рет қаралды 52 М.
Introduction To Eloquent | Laravel For Beginners | Learn Laravel
45:20
He bought this so I can drive too🥹😭 #tiktok #elsarca
00:22
Elsa Arca
Рет қаралды 47 МЛН
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 33 МЛН
My daughter is creative when it comes to eating food #funny #comedy #cute #baby#smart girl
00:17
Tailwind Css Tutorial |  Gradient  - Backdrop Blur
6:22
dorinelJs
Рет қаралды 15 М.
This MacBook was really really really really dirty #413
36:27
Adamant IT
Рет қаралды 9 М.
How To Connect Your React Frontend To Your AspNetCore Backend
23:13
Little-Known AI Tools Giving Academics an Unfair Advantage
9:58
Andy Stapleton
Рет қаралды 11 М.
Query Builder | Laravel For Beginners | Learn Laravel
17:09
Code With Dary
Рет қаралды 24 М.
He bought this so I can drive too🥹😭 #tiktok #elsarca
00:22
Elsa Arca
Рет қаралды 47 МЛН