NotFoundHttpException in RouteCollection.php after renaming the project - laravel-5.3

Please follow the steps below (For laravel 5.3)
1- I have laravel project named projabc and then I have created new folder with name projxyz and copied the contents of projabc into it, after that I have run the command in projxyz
php artisan app:name projxyz
It shows the message
Application namespace set!
2- Created the alias in wamp apache alias directories
3- My routes other than home page (http://localhost/projxyz/) did not work
4- I have then executed other several commands like
php artisan route:clear
php artisan clear-compiled
php artisan cache:clear
composer dumpautoload
Still it throws the error (NotFoundHttpException in RouteCollection.php on line 161) when I access my other routes like
Route::get('/Contact-Us',function(){
return view('front.contact_us');
});
by calling http://localhost/projxyz/Contact-Us

Related

Symfony 6, Can't create a controller

I've installed Php 8 and I try to start coding with Symfony but I can't even create a controller.
I've created my project with:
create-project symfony/website-skeleton covid
The project was created with the version 6.1.99.
Then, in VScode, I used
symfony console make:controller Home
and it give me an error:
Parse error: syntax error, unexpected '?' in D:\Bureau\dev\covid\vendor\autoload_runtime.php on line 15
I don't understand why it's happening. Any idea ?
Edit:
It works fine if I use
php bin/console make:controller home
It seems I just can't use the symfony commands.

Symfony 4 production WebProfiler route

I try to change a Symfony 4.4 in production mode but after executing this command line from the documentation : APP_ENV=prod APP_DEBUG=0 php bin/console cache:clear
I get this error :
Bundle "WebProfilerBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your App\Kernel.php file? in #WebProfilerBundle/Resources/config/routing/wdt.xml (which is being imported from "/home/admin/mercenaries/config/routes/dev/web_profiler.yaml")
The env is correct because the bundle is not loaded.
But how do I do for cancel this routes/dev repository to load ?

Symfony deploying: RuntimeException in DebugClassLoader.php line 258:

Hello I have trouble by deploying my Symfony Projekt to my hoster.
I use: Symfony 2.8 with php 7.1.6
I do the following steps :
1. made a "composer update" on the project
2. cleaning the cache: "php app/console cache:clear -e prod"
3. Upload the files to the hoster
I copy the structure like on my system:
- htdocs-Folder
- app
- bin
- src
- vendor
- test
- web
When I open the website with: www.mydomaine.com/web/app_dev.php I get the following message:
screenshort - error message
Have anyone an idea why ?
THX
It was necessary to delete (make empty) the "prod"-cache folder manually, the command to clear the cache was not enough.

How to install mmoreramerino/GearmanBundle with Symfony 2.1.x?

I am pretty new to Symfony 2 and brand new to Gearman.
I am looking for a bundle to integrate Symfony 2 with Gearman.
mmoreramerino's bundle seems to be the most popular bundle according to packagist. Unfortunately something seems to be broken, the autoloader does not find the bundle.
Fatal error: Class 'Mmoreramerino\GearmanBundle\MmoreramerinoGearmanBundle' not found in ...
I tried switching to "dev-development" as I got from the issues that it was fixed in this branch, but it did not work for me as well.
Question: How can I install this bundle using Symfony 2.1.x?
Question 2: Are there any working & documented alternatives?
Edit In case someone else comes across this question: Here is how I got it up and running!
Install gearman, libgearman, the PECL extension for PHP (use recent versions!)
check that gearman shows up in phpinfo() (both cli and webserver version)
start gearmand in terminal 1 using "gearmand --verbose INFO" (you will see workers & clients connect to gearman - or not ;-))
start in terminal 2 reverse_worker.php from the gearman php extension example directory
start in terminal 3 reverse_client.php from the gearman php extension example directory
If this is working, you are ready for Symfony: install mmoreramerino/GearmanBundle using "dev-development"
copy dev.base.yml from the bundle to app/config/gearman/dev.yml
Now add TestWorker.php to your bundle as outlined in the documentation
enable the testWorker by using the console script "php app/console gearman:job:execute MmoreramerinoGearmanBundleWorkerstestWorker~test"
now you are able to send jobs to the listening testWorker in a Symfony controller (or somewhere else in Symfony). I had to specify the server though I am using the default host/port.
$gearman = $this->get('gearman');
$gearman->setServer('127.0.0.1',4730);
$gearman->doNormalJob('MmoreramerinoGearmanBundleWorkerstestWorker~test');
To install the bundle, you need to add the following line to composer.json
"Mmoreramerino/GearmanBundle": "dev-development"
and run composer update;
Then register it in app/AppKernel.php (it seems you have already done this)
new Mmoreramerino\GearmanBundle\MmoreramerinoGearmanBundle(),

Command "make:resource" is not defined

I am trying to make resource for my API in Laravel But when I run php artisan make:resource resourceName
I get 'error' message
Command "make:resource" is not defined.
Did you mean one of these?
make:auth
make:command
make:controller
make:event
make:job
make:listener
make:mail
make:middleware
make:migration
make:model
make:notification
make:policy
make:provider
make:request
make:seeder
make:test
I've tried to update my composer but it didn't help.
I also checked on my "php artisan list" if make:resource command exists, it doesn't.
How do I 'import' that command into my list or is there any way to make resource without that command?

Resources