donpuerto's avatar

Laravel to mobile app (Android/IOS Platform)

Is it possible to use Laravel for mobile apps (Android and iOS) as way to connect to a server and use validation from Laravel for the mobile app?

0 likes
30 replies
stevenobird's avatar

Laravel is a PHP application - PHP is an interpreter language. Android and iOS apps are applications are mostly written in a compiled language like Java or C/ObjC/C++/C#.

Apps are not how PHP is working. PHP parses files and creates answers depending on what is needed (mostly HTML pages or JSON responses in Laravel terms) and ends its execution. Without an interpreter (php, php-cli, ...) those scripts won't even work

Apps are a bit different - it would take some time to explain these circumstances, so I have to make it short. Apps are compiled (so can be used at any time in the runtime framework).

In short words: No, not in an easy way.

2 likes
donpuerto's avatar

@twaileit Okay. But there should be a tools were we could able to install on Android/IOS that will run on a browser. Otherwise programming on Web will be obsolete if we don't have diversity in terms of running in all platforms.

3 likes
stevenobird's avatar

Well, why should someone install an "app" for something that runs on a browser (so it can be called out of an app context anyways)?

That makes no sence for me.

1 like
donpuerto's avatar

@twaileit It has sense i believe ;) #1 One click in your phone. #2 Available on playstore.

4 likes
stevenobird's avatar

Like I said, not with PHP applications - thats not what PHP was made for and how it is working.

If you want your Laravel app to be working on a smartphone, just access it with a browser - no app needed.

3 likes
toby's avatar

@donpuerto you just need a "full screen browser" app with a predefined url... So you would create your PHP app, host it on any server and load the URL directly within your "app" (which essentially is just a web view component)...

The "One click" option could be also done via a bookmark, though.

4 likes
bagiapit's avatar

You can use Laravel reponse API and Mobile get API, write mobile Application.

6 likes
poorcoder's avatar

I am developing mobile app with Native Script ( JS + Css + Xml ) mobile application development platform... It's easy to use and understand if you know web technologies...

You can use Laravel as back-end service API and you can develop you application with {NS}

https://www.nativescript.org/about

7 likes
kiko's avatar

of course, and having s many prebuild modules laravel makes it sweet. think about laravel as the cloud where all data in your aps get saved, think about the apps as clients consumimg web services that provides your apps content.

Being more precise you can use multiplatform apps made with javascrip frameworks like angularjs encapsulated in cordova or use native languages for each platform.

Laravel its perfect to acomplish all this, for apps consuming web services you allways need a server a sort of a database and a server programming language.

Go for it!

1 like
ejdelmonico's avatar

What you could do is write apps with a simple webview and develop an api with laravel to support the front end. It is done all the time but I am not a believer in doing. It just costs too much just to say you have a native app. You can simulate a native app with current tools and proper manifest caching.

DevroMeister's avatar

Hi All,

I used a tool called website2apk which "compiles" your Laravel app (or any web based language) into APK format. In it's "compiled form" it uses my webserver which hosts the web version as an API.

It looks and feels like an Android app and it's in APK format. After a few hours of playing around I uploaded it to Google Play Store successfully. I write alot of PHP and other web languages but never learnt anything Android related as it seemed rather daunting although this process was a breeze.

It is quite awesome to have an APK to send to your friends or upload to GP Store. Feel free to contact me if you would like any info on the process or to get a feel of how the app performs search for FoodTrees on Google play or FoodTrees.org.

Hope this helps speeding up the process for anyone wanting to get an app published without having to go through the hassle of learning any native languages.

7 likes
jesus@jesco.com.mx's avatar

Hi Devro,

I´d like to know more about Laravel APPS... we are actually developing in Xamarin.. and I want to explorer the posibility to use laravel to develop Android and IOS apps... can you send me and e mail please So I can contact you?

[email protected]

Regards

ederson's avatar

If you want to get your hands a bit more dirty you can try something ionic

But in any case there are limitations as you are not developing a real android app

khuankhuan's avatar

Hi Devro,

I'd like to know more about your website2apk, how can I contact you?

My email is: khuankhuan168@hotmail.com

Regards.

srayan's avatar

Hi @DevroMeister

I'd like to know also more about website2apk.

I have already developed my application using laravel, and was looking into ways to turn into a mobile app.

I have researched about phonegap, but have found that it's not so straightforward. I am looking for a quick solution.

My email is: [email protected]

Really appreciate it.

Regards

1 like
sharjeel's avatar

You can use "Ionic" to build the App

1 like
noriods's avatar

I was looking for the same thing for my Flarum-based forum. (Flarum is based—albeit loosely—on Laravel.)

Found this: https://codecanyon.net/item/universal-webview-ios-app-push-notification-swift-admob-inapp-purchase/17383449

There's also a link there to an Android version.

So what is it?

  • A webview app (ie: it loads your Laravel app like a browser would but the user doesn't get any other browser features. So if they want to refresh, they'll need to click a button you created to refresh.)
  • With Firebase for notifications.
  • And some other options like ads via AdMob.

For me, this is exactly what I need seeing as Flarum is a SPA. Hope this helps someone else out there.

noriods's avatar

@JeffreyWay I'd love a Laracasts mobile app ;) Would also make for a great tutorial. I've wanted to do this for years but (clearly) I was too lazy to really research it :P

10 likes
jayandholariya's avatar

@donpuerto If you’re looking to use Laravel for a mobile app, you can consider building the application with Flutter. Within Flutter, you can load a WebView of your Laravel application. To ensure a smooth user experience, make sure your Laravel app is responsive so it displays well on mobile devices.

pakistanimoon-5585103's avatar

Now you can achieve this for Desktop & Mobile Apps using NativePHP and other similar platforms

nativephp.com

Please or to participate in this conversation.