Routes file lost - Laravel - php

Just started out working with Laravel and Homestead.
I followed below guide for that :
https://www.youtube.com/watch?v=S3kaQDFJiis
and did everything exactly the same, but when I open my project Laravel/app/Http there's no routes.php file just kernel.php.
What could possibly cause this? How to fix this? Maybe I messed up something during installation? I did try to re-install everything, but I faced same problem.

If you're using the latest version of Laravel, the routes can now be found in
Laravel/routes/
This folder contains 3 different files each used for their respective consumption methods api web console

I think you are using laravel latest version which is "5.3.*".
From laravel 5.3 routes has found a new home which is under
projectname/routes/.
routes directory has 3 php file
api.php
console.php
web.php
You can check your Laravel version form projectname/composer.json under require as "laravel/framework": "5.3."*
Reference:
Laravel 5.3

Keep note that from Laravel 5.3 the routes.php file has been removed and moved to
laravel_project_folder/routes/web.php
laravel_project_folder/routes/api.php
See Laravel 5.3 Routing Docs & Laravel Upgrade Guide Section
Hope this helps!

You will find it in
1)routes/web.php
You can also read the use of api.php and console.php files as they are also used in routing

Related

Access Core PHP folder inside a Laravel 8 project

Laravel Project is installed in my root directory and I have another project inside root directory with Core PHP ,
COREPHP-PROJECT is the one I want to access , but every time I try to access example.com/COREPHP-PROJECT it's giving me 404 error.
I have tried more than 50 solutions from internet and nothing is working so far.
What I'm doing wrong here?
NOTE: .htaccess file is renamed as I wanted to test without it too.
I think it is actually fine to have a project directory inside the applications root directory. A good application should not be build inside the framework. It should be build with the framework. If in 5 years somehow laravel is not anymore supported you can decouple it more easy and use it in a new framework.
You just need to assign the path to your composer.json under the psr-4 part.
"autoload": {
"psr-4": {
"MainApplication\\": "app/",
"CorePhpProject\\": "CORE-PHP-PROJECT/app/",
But you should only route over the Laravel router.
You can add your routes inside laravels RouteServiceProvider.php
Have a look at the documentation:
https://laravel.com/docs/8.x/routing#the-default-route-files
Should look something like this then:
Route::prefix('coreproject')
->group(base_path('CORE-PHP-PROJECT/routes/web.php'));
Then you can call your laravel routes like this
/home
and the project one are called like /coreproject/home
I got into same task of integrating core php folder inside laravel , therefore solution i found that create a core php file with extension test.php in public folder at laravel root, and try to access in browser after php artisan serve, you will find you can access it.

Missing routes after upgrading Laravel 5.1 to 5.2

After I upgraded Laravel from 5.1 to 5.2
php artisan route:list
returns andempty list of routes. Also I got this error:
NotFoundHttpException
The file routes.php is in the app\Http folder. It seems that the file "routes.php" is not visible at all.
Are you using Route::controller? Laravel 5.2 deprecated that.
Implicit controller routes using Route::controller have been deprecated. Please use explicit route registration in your routes file. This will likely be extracted into a package.

Routes file not properly loaded

I have just installed a new installation of Laravel using composer as per the laravel docs. The documentation refers to the app/routes.php file which is used to map routes to controllers or closed functions. First, there was no app/routes.php file so I created one. Now the routes I've copied from the laravel documentation aren't being found when accessing via the browser. In fact the app/routes.php file isn't even being found by the application as I have put a die statement in there and nothing. It has nothing to do with .htaccess. I am using the default .htaccess and redirects are working. I thought maybe it has something to do with the composer.json autoload array so I have tested that and nothing. Not a jot. Either I'm being thick or there is something fundamental which isn't being explained in the docs. I'm running the latest version of laravel. Any ideas?
Laravel changed the folder structure with its latest release (which is version 5):
In 4.2: app/routes.php
In 5.0: app/Http/routes.php
There's also a few things you need to do in order for a Laravel Project to work. First (and this is the method I use) create a symbolic link to your project's public folder:
ln -s /path/to/webroot/example_app/public /path/to/webroot/example
Next, change the permissions on your storage folder:
chmod 777 -R storage
You should now be able to access localhost/example and the Laravel 5 welcome page should show up. Usually I call my project example_app and create a link to a folder called example, so I can easily access it via localhost/example
In Laravel 5, the routes file is located elsewhere: app/Http/routes.php.
Basically I did chmod 777 on the storage and vendor files and it started working

Laravel 5 view not found

I'm having the weirdest error in Laravel 5, and I haven't had this happen in any of my other projects.
Problem
I receive the following error when I try to hit my app
No such file or directory (View: /home/vagrant/Code/resources/views/layout/master.blade.php) (View: /home/vagrant/Code/resources/views/layout/master.blade.php)
However, in my directory structure
And in my blade template
#extends('layout.master')
#section('content')
jfoewifjewo[ij
#endsection
In my controller
public function index()
{
return view('home');
}
Anyone else hit this issue? I've never encountered it before. Yes storage has read/write on both local and homestead.
UPDATE: I'm on Laravel 5.0.13
This issue lies with using Laravel Elixir with homestead. I went back to MAMP to see if I got the same error and what it told me was that I was missing the rev-manifest.json file in public/build. After some digging, I found out that if you don't apply the "versions" function to the elixir function in your gulpfile, the build folder won't be generated and calls to the "elixir" function in your blade templates will fail. This appears to bubble up as an error in finding the view, when it's actually an issue finding a view dependency.
Use gulp to build your sass or less files for sure, but for the time being stick with just URL::asset() to get your javascript and css file paths generated until all the kinks with elixir are worked out.
This is a well know version issue Laravel 5.0.1 (#Zarathuztra version) Here is some comments about the issue: https://laracasts.com/discuss/channels/general-discussion/laravel-5-error-out-of-the-box-with-update-route-throws-an-error
Search for "PratyushPundir" and from them you will see some people having the same issue
Updating Laravel should fix it.
I fix it by add the version. Because after add the version in gulp, it will generate rev-mainfest.json.
original gulp in homestead
elixir(function(mix) {
mix.sass('app.scss');
});
I change to
elixir(function(mix) {
mix.sass('app.scss')
.version(["public/css/app.css"]);
});
And it works.

symfony 1.4 : unable to find config file : ProjectConfiguration.class.php

I have installed symfony in my local server using their docs, but as per http://www.symfony-project.org/getting-started/1_4/en/04-Project-Setup I have to change edit config/ProjectConfiguration.class.php. but I didnt see this file, I am using symfony 1.4, how do I change the path
Thanks a lot
Did you generate a project after checking out/unzipping the core Symfony code into lib/vendor/symfony?
php lib/vendor/symfony/data/bin/symfony generate:project myProjectName
will set up a project for you. Until you do this, you won't have the config/ProjectConfiguration.class.php file you mention in your question. See this part of the docs for details.

Categories