Created
December 28, 2015 21:37
-
-
Save jackfruh/26117250a1af5c30bc16 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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]); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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