Support the ongoing development of Laravel.io →
Requests Views Architecture

I'm adding a mobile-friendly website to my laravel app, so I added the following code to /app/config/views.php

use Jenssegers\Agent\Agent as Agent;
$Agent = new Agent();
// agent detection influences the view storage path
if ($Agent->isMobile()) {
    $viewPath = __DIR__.'/../views/mobile';
} else {
    $viewPath = __DIR__.'/../views';
}

And that works great. The problem is, that I'm trying to send an email and laravel expects the email's view file also to be under /mobile directory, is there any way I can tell emails to still always load from /views/ and not /views/mobile?

Last updated 3 years ago.
0

I go to this forum all the time on a mobile device. Try it yourself. Well written html works great on a mobile site.
Usually the key is us absolute sizing rather than percent.
This:

div#tbl-container {
width: 800px;
height: 300px;
overflow: auto;

Not:

div#tbl-container {
width: 90%;
height: 50%;
overflow: auto;

Test it, bring up this site on a mobile device, you can expand and contract size very easy.
I have been on some so called mobile sites where you cannot expand and contract.
Well written html is the answer weather mobile or not.

Last updated 3 years ago.
0

Hmm that's not really what I mean, but thanks anyway jimgwhit,

There's an answer on http://stackoverflow.com/questions/27232429/laravel-mobile-support

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Binternet binternet Joined 1 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.