Skip to content

Instantly share code, notes, and snippets.

@jackfruh
Created December 28, 2015 21:37
Show Gist options
  • Save jackfruh/26117250a1af5c30bc16 to your computer and use it in GitHub Desktop.
Save jackfruh/26117250a1af5c30bc16 to your computer and use it in GitHub Desktop.
<?php namespace App\Http\Controllers;
Use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Event;
class MobileController extends Controller
{
public function speakers($slug)
{
$event = Event::where('slug', '=', $slug)->firstOrFail();
$qry = "SELECT * from View_complex";
$users = DB::select($qry, [$event->id]);
return view('layouts.mobilespeakers', ['event' => $event, 'speakers' => $users]);
}
}
$domainName = App::environment('local') ? "mydomain.local" : "mydomain.com";
Route::group(['domain' => "{eventid}.$domainName"], function () {
Route::get('/mobile/', 'MobileController@eventindex');
Route::get('/mobile/speakers', 'MobileController@speakers');
});
# here we have a problem, the action command tries to figure out what url to build based on the controller.
# the controller, takes 1 parameter, but we don't pass that here.
# since we're using domain routing, we get the parameter as part of the domain name in the routes.php file.
<li>
<a href="{{ action('MobileController@speakers' ) }}" >Speakers</a>
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment