hirezadehghani's avatar

hirezadehghani wrote a comment+100 XP

1w ago

Laravel From Scratch (2026 Edition): Ep 10, Controllers

After migrating routes to controller, Mr. Way doesn't use resource Route::resource I am don't understand why?

hirezadehghani's avatar

hirezadehghani liked a comment+100 XP

1w ago

Laravel From Scratch (2026 Edition): Ep 10, Controllers

@Tray2 thank you sir you saved me after 4 hours i dont know what was happening getting crazy !!!

hirezadehghani's avatar

hirezadehghani liked a comment+100 XP

1w ago

Laravel From Scratch (2026 Edition): Ep 10, Controllers

One important thing when creating routes like that, is the order.

Route::get('/ideas/create', [IdeaController::class, 'index']);

Must be defined before

Route::get('/ideas/{idea}', [IdeaController::class, 'show']);

Or you will scratch your head as to why you get a 404 when trying to navigate to the create Idea route.

hirezadehghani's avatar

hirezadehghani wrote a reply+100 XP

1w ago

Need front-end developer for a increasing my experience (For free)

Hi Vincent! No, I just want a teammate. I don't know why others are thinking that this is a scam. I just want to review my learning through a project. I do many learning projects on my own (solo), but I want to change this by working with another developer remotely. The idea of the project or other things could change based on your opinion, and everything, such as credit or other things, could be kept for us. (The project will be on GitHub)

hirezadehghani's avatar

hirezadehghani liked a comment+100 XP

1w ago

hirezadehghani's avatar

hirezadehghani wrote a reply+100 XP

1w ago

Need front-end developer for a increasing my experience (For free)

Thank you please sending a message to me at linkedin for talking about it: this is linkedin profile: https://linkedin.com/in/hirezadehghani

hirezadehghani's avatar

hirezadehghani liked a comment+100 XP

1w ago

Need front-end developer for a increasing my experience (For free)

I'm interested to get's my hands dirty 😊😬

hirezadehghani's avatar

hirezadehghani started a new conversation+100 XP

1w ago

Need front-end developer for a increasing my experience (For free)

Hello everyone! (working for free) (Please notice that this project is just a portfolio, and I don't have any budget for it!) If I sent it in the wrong place, please delete it and help me to put it in the right place.

I want to create a project for my portfolio (Laravel). I am looking for a front-end developer (React or Vue developer) who will work on it together! My idea is a CRM like but we can change the idea completely. I am a junior Laravel developer, so no need to worry about the level. If you are interested or know anyone who is, let's build something together. The back end of the project is Laravel.

hirezadehghani's avatar

hirezadehghani liked a comment+100 XP

1mo ago

Very slow local application response time

Certainly! Slow local performance in Laravel (especially on Windows) is a common pain point, and it can be due to several factors. Here’s a step-by-step approach to diagnose and improve your local app’s response time:

1. Profiling with Laravel Telescope

Install Laravel Telescope to get a more granular view of what’s happening during the request lifecycle:

composer require laravel/telescope --dev
php artisan telescope:install
php artisan migrate
php artisan telescope:publish

Visit /telescope and inspect the timeline for each request. This will help you see which service providers, middleware, or listeners are taking the most time.


2. Debugging Service Providers and Booting

Since most time is spent in "Application" and "Booting", try profiling your service providers:

  • Temporarily comment out custom or third-party service providers in config/app.php and see if performance improves.
  • If you identify a culprit, dig into its boot method for heavy operations.

3. Middleware Profiling

Since you suspect middleware (especially with tenancyforlaravel), try disabling them temporarily:

  • Comment out middleware in app/Http/Kernel.php and test.
  • If you see a big improvement, re-enable them one by one to isolate the slow one.

You can also log middleware execution time:

// In a middleware handle() method
$start = microtime(true);
$response = $next($request);
\Log::info('Middleware X took: ' . (microtime(true) - $start) . ' seconds');
return $response;

4. Windows Filesystem Performance

Windows is notoriously slow with many file operations (autoloading, config caching, etc). Try these:

  • Enable Opcache in your PHP config.
  • Use WSL2 (Windows Subsystem for Linux) for your dev environment if possible. Performance is much closer to production Linux.
  • Check for antivirus interference: Exclude your project directory from Windows Defender or any antivirus.

5. Optimize Laravel Caches

Run these commands to optimize your app:

php artisan config:cache
php artisan route:cache
php artisan view:cache
composer dump-autoload -o

6. Check Composer Dependencies

Large or unnecessary dependencies can slow down bootstrapping. Run:

composer install --optimize-autoloader --no-dev

7. Tenancyforlaravel Specifics

If you’re using tenancyforlaravel:

  • Make sure you’re not running expensive tenant resolution logic on every request.
  • Profile the package’s middleware and listeners as above.

8. Xdebug

If you have Xdebug enabled, it can slow things down considerably. Disable it unless you’re actively debugging.


9. Hardware and Herd Pro

  • Ensure Herd Pro is using the latest PHP version.
  • Try increasing the allocated resources (CPU, RAM) for Herd Pro.

10. Final Step: Compare with Production

If you have SSH access to production, run php artisan profile:requests (with spatie/laravel-ray) to compare timings.


Summary:

  • Use Telescope for profiling.
  • Isolate slow service providers/middleware.
  • Optimize caches.
  • Consider WSL2 for better filesystem performance.
  • Profile any custom or package code that runs on every request.

Let me know if you need help with any of these steps or want to share more specific Telescope or Debugbar output!

hirezadehghani's avatar

hirezadehghani liked a comment+100 XP

1mo ago

should I use text or longtext for table column?

whats the difference? is text() enough?

I just found abuot this: $table->longText('description');

and made me wonder if text alone would be enough for content that can be of any lenght, lets say blog post, which one do you use?