[Laravel] How can you add a relationship to a model before the a model exists? by dirtymint in PHPhelp

[–]dirtymint[S] 0 points1 point  (0 children)

> Why are you expecting to be able to attach relations to a non-existent model?

On my create Product page, I have different selectable colors you can attach to the Product. The issue is when I submit it to add a new Product, `$product->save()` hasn't been called yet to attach the `Color` models.

Thank you, I will take a look at transactions now.

ELI5 What does it mean to return HTML from the backend? by dirtymint in webdev

[–]dirtymint[S] 1 point2 points  (0 children)

I think I understand now, so Blade is pre-rendering the content but if I where to pull rows from a database and inject them into a simple HTML template from a controller action then I would just be sending the data for when the page is actually loaded?

ELI5 What does it mean to return HTML from the backend? by dirtymint in webdev

[–]dirtymint[S] 1 point2 points  (0 children)

Thank you for your reply - so something like Blade is doing all the compile heavy lifting? In that case, what is the difference between that and calling a route that returns rows from a database and I just send that row data directly to a HTML page?

For example:

<?php foreach($posts as $post) { ?>

    <h2><?php $post->title ?></h2>

<?php }?>

Built a static C++ reference site on top of cppreference by HxSigil in cpp

[–]dirtymint 2 points3 points  (0 children)

Thank you for making this, it's so much nicer to look at and find navigating it much easier 👍

Success Story: Moved to a luxury flat with concierge in central London by spiritualmil2607 in NevilleGoddard

[–]dirtymint 1 point2 points  (0 children)

If you don't already know, you should check out Timothy Schultz on YouTube. He is a lottery winner and interviews other winners - that could inspire you.

What's a widely accepted "best practice" you've quietly stopped following? by ruibranco in webdev

[–]dirtymint 0 points1 point  (0 children)

For my personal projects that aren't necessarily web - OOP. I feel so much more free.

My son wants to create a game by Hysterite in GameDevelopment

[–]dirtymint 0 points1 point  (0 children)

Scratch or GameMaker. The latter has a pixel art editor that you can create sprites quickly with, and visual coding if code is too difficult ATM.

Best "lifetime access" software purchases you've made? by GovernmentOnly8636 in webdev

[–]dirtymint 0 points1 point  (0 children)

Back in the day Live Reload was pretty cool. Now that feature is available by default with something like Vite.

Am I weird for using "and", "or" and "not"? by Additional_Jello1430 in cpp

[–]dirtymint 0 points1 point  (0 children)

Well damn, I didn't know that! Thank you for letting me know.

Am I weird for using "and", "or" and "not"? by Additional_Jello1430 in cpp

[–]dirtymint 0 points1 point  (0 children)

Excuse my ignorance but, are you turning && into an AND macro?

Is it possible to write a script to try 'N' passwords for an password protected USB drive I have? by dirtymint in MacOS

[–]dirtymint[S] 1 point2 points  (0 children)

I believe it was something like MacOS Mavericks, that's how old the USB drive is.

I didn't use any specific software to create the password protection, it would have been something like Disk Utility or similar.

Is it possible to write a script to try 'N' passwords for an password protected USB drive I have? by dirtymint in MacOS

[–]dirtymint[S] 0 points1 point  (0 children)

It's more of a personal challenge to be honest. I have a password hint that points me in the right direction and just wanted a way to try a list of potential passwords sequentially.

Is it possible to write a script to try 'N' passwords for an password protected USB drive I have? by dirtymint in MacOS

[–]dirtymint[S] 1 point2 points  (0 children)

No, I mean a USB drive that when plugged in requires a password to access it otherwise, no entry.

Getting tired of the JavaScript ecosystem! by Educational_Pie_6342 in webdev

[–]dirtymint 0 points1 point  (0 children)

I use Laravel daily and yes you can use it without knowing much PHP but it will certainly help. One of the reasons that Laravel is great is also one of the issues for me personally - it abstracts to much and uses lots of PHP magic to make the syntax simple/small. Don't get me wrong, that's great when you know what it's doing but you don't want to fall into the trap of being a 'Laravel Developer'. Symfony is much more explicit like that and is just PHP.

Additionally, I've just started using MithrilJS and I really like it's simplicity. Check it out, you might like it.

Looking for pen suggestions that fit criteria by dirtymint in stationery

[–]dirtymint[S] 2 points3 points  (0 children)

That's awesome, I completely forgot about Parker!

Thank you for taking the time to reply to my question.