Running a Laravel Application alongside another app - php

So I have a question relating running a Laravel application alongside another application and how I can achieve getting past (or utilising) Laravel's routing to run them in harmony.
So assume we have the following file structure
Public_html
/public - holding Laravel files
/billing - holding WHMCS
How can I get around Laravel not finding routes and throwing an exception? Could I deploy the Laravel app to find the index of public in the root folder instead?

Related

How to run AngularJS project with Laravel

I want run my Angular front-end client within Laravale index.html.
I have mange to set up and build both projects. When I open Laravel Client at port 8000 it says it can not find any of the .js files (404 error).
I read something about base href to be set properly but I can not figure it out.
Any ideas ?
Create a new project with Angular Cli in some directory of Laravel project and then build the frontend project and copy the “dist” files in the public directory and in Laravel routes “/” render the index.html and that's it.
For more info you can follow this tutorial. I hope it would help you.

Laravel Mix hot reloading inside the package

I've been trying to create an admin panel for Laravel (I know, there is a Laravel Nova now for 99$ for a single site) and all I've been doing is trying to build all of this functionality on top of laravel/laravel package.
What I've seen with Nova, is that it is a separate package, which is seamlessly integrates with Laravel by simply dragging and dropping the folder with Nova to the root directory of the Laravel application.
Even though, I have an idea (and a little bit of experience) on how to replicate (and maybe even enhance Nova functionality), I've no idea on how to make HMR working with the package.
Let's say my package name is Niva (just an example), with the folder named niva placed inside the Laravel folder. The webpack.mix.js is the same as in the Laravel Horizon package.
So far, I've no problems with accessing routes defined in the package, I'm able to load views from the package by accessing specified route, even authentication works just fine. However, I have to manually compile the package first, then publish the assets, and only then I can view the changes I've made to the source code.
Example package base routes:
Web: _http://localhost/niva (Only need for HMR to be present here)
Api: _http://localhost/api/niva
Example package base directories and files:
Root: /var/www/localhost/niva
Public: /var/www/localhost/niva/public
Resources: /var/www/localhost/niva/resources
Webpack: /var/www/localhost/niva/webpack.mix.js
What I'm asking about is: is it possible to enable HMR for the package, and how it should be done?
P.S. I've been thinking of symlinking the public directory from the package to the public vendor/niva folder, but still no result (I'm pretty sure I'm missing something here).

Laravel project within another laravel project

I have project which is built with laravel 3.
Currently, I made another products using Laravel 5.2.
Is it possible to have Laravel 5.2 within Laravel 3. HOST do not care what framework is used.
In this case we have two ROUTES.
Both uses same DB.
It would be real nice if we could do this:
http://aaaa.com/ is the main application which is redirected to public_html
and is it possible to do this:
http://aaaa.com/laravel5/ is the application in Laravel 5.2 redirect to public.
What do I have to do in .htaccess?
any help would be nice

Laravel 5.1 + phpsysinfo - how?

I'm currently experimenting with Laravel 5.1
I want to display realtime resource usage and thus I found phpsysinfo. I've required it into my project via composer and I'm able to run and view a working version by viewing phpsysinfo's root directory.
How do I actually then start displaying this on my /public pages ? I can't see any type of syntax on phpsysinfo's documentation.

PHP - First Time Installation of Laravel 4 on VPS

Hey so I am completely new to Laravel 4 and have some basic questions regarding my first time installation that I was unable to find answers to anywhere else on-line. I am planning of hosting a standard website with a fully dynamic web back end and a RESTful API using the framework. I have been following this installation guide and am essentially at the part where I type laravel new projectDir and it creates a new instance of Laravel in the provided directory.
Now my main public directory is public_html, is it recommended to install Laravel 4 directly into that directory. So is something like laravel new public_html recommended? I have found many other questions here that seem to suggest that this is not the safest solution. Should I make a separate directory inside public_html, is it necessary for what I am planning on doing with laravel?
Also, I would like to keep my URL's as neat as possible and would like them primarily to be www.domain-name.com/pagename for the website. Will creating a directory inside of public_html disable me from doing so?
Lastly I had some issues with routing my URL's when I tried to install a different framework on this server. Are there any server/Apache settings that would impact how URL's are routed with laravel that I should disable/enable before I install Laravel into a directory?
you would not put the base Laravel folder in public_html.
In a Laravel directory structure, which gets created when you do the laravel new command, there is a directory called public. This is what you map your web root to. So on my vps, I have a folder called /var/site/mywebapp which was created by the command:
laravel new mywebapp
In nginx (which I much prefer over Apache), I map my server root to:
/var/sites/mywebapp/public
In the public folder is an index.php that Laravel uses to run your whole app/site. The rest of the framework is outside of the web root and is not accessible by HTTP.
As for your URL issues, consult the documentation for how to properly configure your mod_rewrite (assuming Apache).
Also, Dayle Rees, a prominent member of the Laravel community (and core contributor), has a github of sample web server configs here:
https://github.com/daylerees/laravel-website-configs
When you install Laravel it will create a public folder, along with app, bootstrap and vendor folders.
The public folder is essentially your public_html folder where you want your host/apache to point to when viewing the root of your website. So mydomain.com should land directly within the public folder.
You can rename the public folder to public_html just be sure to also update bootstrap/paths.php paths value
'public' => __DIR__.'/../public',
// change to
'public' => __DIR__.'/../public_html',
Laravel will create a .htaccess file for you, which will grab URLs and redirect them to public/index.php which will process Laravel accordingly.
So to answer the question, you install Laravel one folder back from public_html and then you can rename public to public_html if your host requires.

Categories