martinbean wrote a reply+100 XP
1d ago
martinbean wrote a reply+100 XP
1d ago
@leknoppix-708669 How about you just answer my question, instead of providing lots of things I didn’t ask about…?
Show your routes file and how you’re actually registering these routes.
martinbean wrote a reply+100 XP
1d ago
@leknoppix-708669 All of your errors are 404s pointing to not being able to find routes, yet you show absolutely nothing around how you’re actually registering routes.
So, how are you actually registering routes?
My guess is you’ve got some sort of dynamic hostname, and you‘re taking this into account across environments given your tests pass in one environment but not another.
martinbean wrote a reply+100 XP
5d ago
@rseletsk Then mark the post as solved.
martinbean wrote a reply+100 XP
5d ago
@yougotnet I’ve worked on plenty of “multi-tenant” applications like this. Just keep things simple by using foreign keys and route parameters.
For example, one of my projects is a multi-tenant CMS (like Wix or Squarespace). When a user logs into the admin panel, if they belong to multiple websites then they can pick which website they want to manage. When they do, they’re then just redirected to the dashboard route (/websites/{website}/admin). The route group looks like this:
Route::group([
'middleware' => ['auth', 'can:update,website'],
'prefix' => 'websites/{website:slug}/admin',
], static function (): void {
Route::get('/', DashboardController::class)->name('website.admin.dashboard');
// Other website admin routes...
});
Each controller action then gets the current website injected as a parameter, so you can then scope model queries to that website:
namespace App\Http\Controllers\Admin;
class ArticleController extends Controller
{
public function index(Website $website)
{
$articles = $website->articles()->paginate();
return view('admin.article.index', compact('website', 'articles'));
}
public function store(Website $website, StoreArticleRequest $request)
{
$article = $website->articles()->create($request->validated());
return redirect()
->route('website.admin.article.index')
->with('success', 'Article created.');
}
}
martinbean was awarded Best Answer+1000 XP
5d ago
@randy_johnson Ignoring AI has been used to either generate or part-generate this question, mobile apps are a process that runs on the device. It’s client-side. They don’t have things like “sessions”. So you should be obtaining a token, and then storing that token in secure storage like the device’s keychain.
martinbean wrote a reply+100 XP
5d ago
@vincent15000 Free labour by the sounds of it 🙃
martinbean wrote a reply+100 XP
6d ago
@randy_johnson Ignoring AI has been used to either generate or part-generate this question, mobile apps are a process that runs on the device. It’s client-side. They don’t have things like “sessions”. So you should be obtaining a token, and then storing that token in secure storage like the device’s keychain.
martinbean wrote a reply+100 XP
1w ago
@vincent15000 Yes, that was a typo. I meant to write “horizontally scrollable”.
martinbean wrote a reply+100 XP
1w ago
@vincent15000 Either make the table horizontally scalable, or stack the columns on smaller viewports.
martinbean wrote a reply+100 XP
1w ago
@adamnet Awesome! Are you using version control yet?
martinbean wrote a reply+100 XP
1w ago
@dnabeast Did Forge ever say they would definitely install Imagick when provisioning servers? I don’t use Forge, so don’t know what guarantees they make in terms of supported PHP extensions. I also don’t know why you’re then linked to the Herd docs; Herd has nothing to do with Forge and vice versa.
If you require Imagick then I think you will need to put that in your provisioning script. Googling "laravel forge imagick" yielded this result: https://forgerecipes.com/recipes/291/install-enable-imagick-on-php84 (you’ll need to tweak it if you’re using a version of PHP other than 8.4).
martinbean wrote a reply+100 XP
1w ago
@eylay This thread was over half a decade old…
martinbean liked a comment+100 XP
2w ago
Thank you Martin that is most helpful.
martinbean wrote a reply+100 XP
2w ago
@phpmick You should be in control of any and all code making its way into your codebase, whether that’s written by you, a colleague, or an LLM. Here are some tips and guidelines I follow when doing AI-assisted development:
- Give agents very discreet tasks to complete.
- When you’re prompting the agent, ask it to ask you about anything it’s unsure of instead of guessing. You’ll find you’ll get something far more in line with what you had in mind and were expecting, instead of giving an agent a loose description, and it making assumptions and making something that’s maybe 60% of what you wanted.
- Give agents way to verify the work they’re producing. There should be a goal, as well as instructions on how to run any tool such as linting and testing tools. If linting/tests fail, the agent should go back and fix what’s broken before asking for your attention.
- Agents should also be given guardrails to avoid getting stuck in a loop and burning tokens.
- You should only be merging code you actually understand. If you don’t, review the agent output log. If you’re still unsure, then ask the agent to explain what it’s produced. As with human-produced code, less code is easier to grok than lots of code. Don’t have your agent spew out 50,000 lines of code and then review.
martinbean wrote a reply+100 XP
2w ago
@shivamyadav Stream the video how? Via S3?
martinbean wrote a reply+100 XP
2w ago
@shivamyadav Never heard of “UIshare” but you shouldn’t be serving static video files (i.e. MP4s) if this is content you want to control access to.
I’d add another recommendation for something like Mux as well. They will probably deliver video as HLS streams, require the use of signed URLs for playback, and you can even add DRM if you want to go down that route.
I’ve ran a video on demand platform for over 10 years now. I used to use Amazon for storing, transcoding, and delivering video; but moved to Mux maybe three years ago now and it’s far cheaper and easy to integrate. It’s to video what Stripe is to payments.
martinbean wrote a reply+100 XP
2w ago
@gp10devhts No. Printing is a client-side concern.
It would be a huge security issue if a PHP app hosted on some random server somewhere in the world could see what devices (including printers) were on your network.
martinbean wrote a reply+100 XP
2w ago
@kn_swe Can you post the full error message?
martinbean was awarded Best Answer+1000 XP
3w ago
@randy_johnson There’s no magic fix. If you just let AI go wild and just approve everything it does then yeah, your codebase is going to become unmanageable and full of slop. So you need to be specific in your directions and more meticulous on what AI-authored changes you allow into your codebase.
martinbean wrote a reply+100 XP
3w ago
@ismaelaek Don’t know why you want to make your life easier by not using the SDK provided by Meta/Facebook. If that’s the case, then you’ll need to read the API reference and implement the HTTP requests (and everything around it such as authorisation and response handling) yourself from scratch.
martinbean wrote a reply+100 XP
3w ago
@shivamyadav This sounds like something you’d be able to do with server logs. But, as with most of your questions, my question is: why? Are you really going to be billing users for say, downloading style sheets? 😕
martinbean wrote a reply+100 XP
3w ago
@randy_johnson There’s no magic fix. If you just let AI go wild and just approve everything it does then yeah, your codebase is going to become unmanageable and full of slop. So you need to be specific in your directions and more meticulous on what AI-authored changes you allow into your codebase.
martinbean wrote a reply+100 XP
3w ago
@puzbie The two things to look out for will be:
- The skeleton directory structure changed slightly from (I think) Laravel 11. The bootstrapping process was made a bit slimmer.
- Years later, Laravel still can’t decide how new projects should be created and Jetstream became deprecated in favour of “starter kits”. But looking at Jetstream’s composer.json file, it seems to be compatible with Laravel 13, so you should still be able to install it.
martinbean liked a comment+100 XP
3w ago
Error text?..
Are you sure Eloquent in migrations is good? Migrations are about raw database tables/columns, Eloquent is about models which are "next level" compared to DB calls. Sometimes they align, sometimes not. You cannot guarantee your migrations chain is consistent and always replayed with this approach.
I believe you need something like this: https://github.com/TimoKoerber/laravel-one-time-operations
It's like migrations for data, not structure.
martinbean wrote a reply+100 XP
3w ago
You prefer using simple navigation links ?
@vincent15000 Yes. And I dare say a lot of your users would say the same.
martinbean wrote a reply+100 XP
1mo ago
@vincent15000 This is exactly why I don’t like (or implement) “infinite” scroll. It’s a pain in the ass for users.
martinbean wrote a reply+100 XP
1mo ago
@joahi93 You signed up, just to reply to a 2-year-old thread…?
martinbean wrote a reply+100 XP
1mo ago
Then when being processed by the job the 'status' field would get updated. Of course this is something the job shouldn't care about, so I thought well this is where a Contract/Interface would come in handy.
Is this a concept? Basically a Contract/Interface for Eloquent models.
@lsvagusa Yes. That’s the very definition of depend on interfaces, not implementations (the “L” in “SOLID”).
You would type-hint the interface in your job’s constructor, and then your job would call methods defined by that interface without knowing the actual class implementing that interface.
interface HasStatus
{
public function updateStatus(string $newStatus);
}
class UpdateStatusJob implements ShouldQueue
{
use Queueable;
public HasStatus $model;
public function __construct(HasStatus $model)
{
$this->model = $model;
}
public function handle(): void
{
$this->model->updateStatus('complete');
}
}
Your job now doesn’t care if it’s working with an Eloquent model, or if it’s working with an Eloquent model at all. Just so long as the class it receives implements the HasStatus interface.
martinbean wrote a reply+100 XP
1mo ago
@jlrdw This question was over a decade old. That marriage has kids in middle school now! 😄
martinbean wrote a reply+100 XP
1mo ago
@june92 Seriously, how many questions are you going to ask on this topic…?
You keep asking questions that if you do X, you will magically be a senior developer, or if you do Y, you will magically get a job. That’s not how the industry works.
martinbean wrote a reply+100 XP
1mo ago
Shouldn't this at least deserve a 11.x patch?
@gravity_global No, because Laravel 11 stopped receiving security updates March 12th, 2026: https://laravel.com/docs/13.x/releases#support-policy
martinbean wrote a reply+100 XP
1mo ago
@mikelmedina No. You shouldn’t be using helpers to “fix” bad code. You should just be eager-loading the relationships you actually need for a request.
martinbean wrote a reply+100 XP
1mo ago
@june23 What do those “frameworks” have to do with an application? They’re just cloud providers. They have services that you would deploy and run code on. Yes, you can use. You can also create and host a web application without them.
Your question is basically: “Can I make a journey with these vehicles? Car, van, truck.”
You need to get out of this rut of, “if I use X then I will be a proper developer”. You should be using things when it makes sense to use them; not as a box-checking exercise.
martinbean wrote a reply+100 XP
1mo ago
@shivamyadav Which video? And why can’t you take inspiration from what you’ve seen? Why do you need the raw Figma file?
martinbean wrote a reply+100 XP
1mo ago
@gpapamichelakis Why? You should always be using the most recent version of software.
martinbean wrote a reply+100 XP
1mo ago
@digitalartisan So what about “engineers“ that have worked on projects where a load of money has been sunk into it, and the project’s then failed or just been canned? Such as Metaverse, Apple Car, Windows Phone, etc?
martinbean wrote a reply+100 XP
1mo ago
@shivamyadav No. That data lives in the browser. It’s client-side.
If any website could just automatically gobble browser session storage then that would be a massive security risk and attack vector.
You need to come up with a different method to achieve what you’re trying to achieve.
martinbean wrote a reply+100 XP
1mo ago
@june92 A developer will work on anything if you pay them enough to make it worth their while.
martinbean liked a comment+100 XP
1mo ago
I think it depends on their salary.
martinbean wrote a reply+100 XP
1mo ago
@randy_johnson You could also just dispense with it all and put everything in a single index.php script.
martinbean wrote a reply+100 XP
1mo ago
Thanks, ChatGPT.
martinbean wrote a reply+100 XP
1mo ago
@motinska94 Laracasts runs deals around Black Friday (November) each year. If you really want Laracasts access then I’d suggest saving and then purchasing when a subscription is heavily discounted.
martinbean wrote a reply+100 XP
1mo ago
@adamnet Are you actually going to reply? And say why you weren’t using source control when you’ve been told by multiple people to do so for months now…? Or will you just come back in a couple of months’ time with a yet another new post on how you’ve lost work and want to know how to get it back?
martinbean wrote a reply+100 XP
2mos ago
@earmsby 403 is a Forbidden response. So if the code works for one store but not another, it sounds like whatever credentials you’re trying to use does not have the permissions to actually view resources for that store. So the issue is going to be there; not with your code.
martinbean liked a comment+100 XP
2mos ago
martinbean wrote a reply+100 XP
2mos ago
Oh, you're right: thread.
@jussimannisto I seldom forget things I’ve read or seen. It’s a blessing and a curse 😅
martinbean liked a comment+100 XP
2mos ago
Jesus christ!
If that's your senior engineer writing that code today, they need to be sacked, ASAP!
That's not code written by a senior! They might have been there a long time, but they are not a senior engineer.
martinbean wrote a reply+100 XP
2mos ago
@adamnet This is what version control is for. And I’m sure you had been advised to use version control some time ago…?
martinbean wrote a reply+100 XP
2mos ago
@jaeggid That Laracasts series is a bit redundant now that Passkeys are natively supported by Laravel via a first-party package.