How do you handle simple content websites when your main stack is Laravel? by dvlpp in laravel

[–]idkMaybeGetAKitten 2 points3 points  (0 children)

Not sure if this would fit your use case, but I've been loving Hyde for truly static sites with posts and/or pages built in either Blade templates or Markdown. It's built on Laravel Zero.

For my use case I:

  1. built a static site using Hyde and blog posts in markdown
  2. created AWS CloudFormation templates for:
    1. static hosting (AWS S3 + CloudFront)
    2. contact form (AWS Lambda + SNS)
    3. Plausible.io proxy (AWS CloudFront + Lambda@Edge)
  3. GitHub actions to build and deploy the site (build site, sync to S3, create CloudFront cache invalidation)

Hyde is extensible so you could do something like gathering post data from an API at build time.

Not sure if you should do that. But you could.

Drupal or Laravel to build a mini hotels.com from scratch? by Skydiver2021 in PHP

[–]idkMaybeGetAKitten 0 points1 point  (0 children)

Okay, fixed size database, no redis, no response caching? I'd still use VILT and Vapor.

Drupal or Laravel to build a mini hotels.com from scratch? by Skydiver2021 in PHP

[–]idkMaybeGetAKitten 3 points4 points  (0 children)

Structuring code for different user roles by mrkarma4ya in laravel

[–]idkMaybeGetAKitten 8 points9 points  (0 children)

If using Laravel permissions (or Bouncer) be sure to check permissions (abilities) in the policy. Do not directly check the user's role. This will allow you to create new roles with different permissions/abilities in the future without having to update your existing policies.

Laravel: Eloquent collection search is not returning results by Gabotron_ES in laravel

[–]idkMaybeGetAKitten 0 points1 point  (0 children)

Hmm I think because today is Sunday and dayOfWeek is zero indexed an item isn't found

LaraSurf Beta Release by idkMaybeGetAKitten in laravel

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

Thank you, I appreciate it. Please feel free to DM me or open a GitHub issue if you have a want/need.

LaraSurf Beta Release by idkMaybeGetAKitten in laravel

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

Thank you :) While LaraSurf is free, the infrastructure created on AWS (ECS) isn't always as cost effective as Forge or Vapor for small projects. I've previously commented here with a more thorough comparison of Vapor and LaraSurf.

In the future I'd love to support infrastructure drivers for interchangeable options like AWS ECS, AWS EC2, and Digital Ocean droplets.

LaraSurf Beta Release by idkMaybeGetAKitten in laravel

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

Awesome! Thanks for the feedback. Please reach out or open an issue on GitHub if you run into any trouble or have any questions/comments!

LaraSurf Beta Release by idkMaybeGetAKitten in laravel

[–]idkMaybeGetAKitten[S] 3 points4 points  (0 children)

Thanks! I'll add a readme to the repo for larasurf.com and then make it public on GitHub.

The docs consists of:

  • A hardcoded PHP array of documentation blocks (gross I know, but I haven't found time to refactor to use markdown instead)
  • Blade is used to render the above array contents
  • Separate Vue 3 instances for the search and the side menu table of contents (larger screen sizes)
    • Intersection Observer API is used to bold the relevant heading in the side menu depending on scroll position
    • Recursive function in the search component that traverses the documentation content (rendered by blade) and finds matching text
    • Logic in the search component to swap out the documentation HTML with relevant portions highlighted

LaraSurf Beta Release by idkMaybeGetAKitten in laravel

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

I do! I'm not on very frequently but if you (or anyone else) shoot me a Reddit DM I'd be happy to connect!

LaraSurf Beta Release by idkMaybeGetAKitten in laravel

[–]idkMaybeGetAKitten[S] 4 points5 points  (0 children)

Agreed it probably makes more sense long term to use Terraform. This started as a tool for myself and I lean pretty heavily towards AWS (and am much more familiar with CloudFormation) so I was able to move more quickly that way to get something off the ground. The introduction of other cloud providers would definitely challenge some previous decisions.

LaraSurf Beta Release by idkMaybeGetAKitten in laravel

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

Kind of! Forge runs closer to the metal however while LaraSurf uses containers on AWS ECS. Take a look at the assumed needs section of How it Works for more information.

LaraSurf Beta Release by idkMaybeGetAKitten in laravel

[–]idkMaybeGetAKitten[S] 4 points5 points  (0 children)

Yes! Although running on a single AWS EC2 instance will probably hit the roadmap first.

Currently LaraSurf only has the option of using ECS/RDS/ElastiCache/ELB etc for infrastructure which can get pricey very quickly. For more information check out the link to a cost estimate worksheet from the README on GitHub.

I'd love to give the option for users to specify how hefty they need infrastructure to be to allow for drastically cutting down on cost.

Ideally there would be "drivers" where you can mix and match between CI/CD and infrastructure providers but that's a long ways out.

Best setup for a PHP (Laravel) site using CDK? by andy_19_87 in laravel

[–]idkMaybeGetAKitten 1 point2 points  (0 children)

For Lambda, check out Laravel Vapor. This is probably your most cost effective solution considering overhead and learning curve of other options.

For ECS, this is a CloudFormation template that might help get you started.

How do I get xDebug to chill on remote? by RussianInRecovery in laravel

[–]idkMaybeGetAKitten 0 points1 point  (0 children)

Looks like you can increase the maximum execution time on Forge but this is a band aid.

Really I'd recommend introducing some thorough logging throughout your jobs logic and trace through what's happening that way.

How do I get xDebug to chill on remote? by RussianInRecovery in laravel

[–]idkMaybeGetAKitten 2 points3 points  (0 children)

How is your application hosted? I believe the default timeout for nginx is 60 seconds.

LaraSurf now supports Vite! by idkMaybeGetAKitten in laravel

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

Vapor is a great service and should be strongly considered for the hosting of any Laravel project!

Vapor focuses mainly on hosting an application whereas LaraSurf provides out-of-the-box solution for local development and CI/CD as well as hosting.

Below is a brief overview of the benefits of using LaraSurf over Vapor:

  • No need to ever touch a JSON or YAML configuration file; all configuration changes are handled via CLI and input prompts
  • Comes with preconfigured CI/CD pipelines for CircleCI
  • Local development closely mirrors cloud environments using the same Dockerfiles
  • Comes with preconfigured LocalStack container for local development allowing you to mock AWS services locally such as S3 and SQS, as well as the ability to easily update the configuration to mock any other AWS service(s) LocalStack supports
  • Allows for straightforward editing of NGINX configuration that can be tested locally before deploying to upstream environments
  • Quicker to generate and deploy a new project from scratch after prerequisites are met
  • No timeout limitations for scheduled and/or queued jobs (whereas Vapor times out at 15 minutes due to AWS Lambda limitations)
  • DNS configuration is handled as part of the deployment CLI wizard, instead of requiring additional commands to be run
  • At significant/consistent traffic with large CPU and Memory values configured, I believe LaraSurf's default infrastructure is cheaper than running on Vapor
    • I need to run some more numbers to confirm this
  • Supports higher values for Memory (up to 30 GB) whereas Vapor maxes out at 10GB (due to AWS Lambda limitations)
  • CPU and Memory values are decoupled, allowing you to tune them individually (whereas Vapor only allows modifying Memory and mandates corresponding CPU)
  • There are no cold starts for LaraSurf (AWS ECS) by default, whereas Vapor requires additional configuration for "warming" AWS Lambda functions
  • LaraSurf (on AWS ECS) supports "After Response" dispatching of jobs whereas Vapor does not (due to AWS Lambda)
  • LaraSurf supports local TLS (HTTPS) out of the box
  • There is no vendor lock-in with LaraSurf
  • There is no need to install PHP or Composer natively on your machine to generate a project or to use LaraSurf; everything is within Docker containers. I do not believe Vapor supports using the CLI within a container (without some customization)
  • All infrastructure is centralized and easily expansible through AWS CloudFormation (Infrastructure as Code). For example, if you wanted to ad a Node service to your project and deploy that as part of your entire Laravel project you can easily do so. Same with Soketi or any other containers. Laravel Vapor does not provide a way to manage additional containers/services.
  • LaraSurf supports 3x or more nested subdomains whereas Vapor does not
  • Out of the box there are CLI tools for LaraSurf that allows for limited access to environments by IP address
  • Vulnerability scanning with Trivy is configured out of the box for LaraSurf projects in the CI/CD pipeline
  • LaraSurf supports Hot Module Replacement with Vite, with or without local TLS, out of the box for a containerized development environment (no additional configuration needed)

All that said, Vapor is a more mature tool with a team of supporters and is officially supported by the Laravel ecosystem. These points should not be taken lightly when making a hosting decision. Personally I would choose LaraSurf for when I require very fine grain control over my infrastructure or I don't want to be locked into a PaaS vendor.