laravel-4

Laravel-Oauth2 Issue in Laravel 4

☆樱花仙子☆ 提交于 2019-12-11 16:41:58
问题 I am using the laravel-oauth2 package for Laravel 4 to set up a Facebook login. I am using the package seen here: https://github.com/madewithlove/laravel-oauth2 When running the page that controls the login, the public/oauth/facebook, the Facebook prompt comes up fine, but when I click "accept", the page spits out the following error: ErrorException Argument 1 passed to OAuth2\Provider\Facebook::get_user_info() must be an instance of OAuth2\Token\Token_Access, instance of OAuth2\Token_Access

Laravel 4 - Sorting Data

折月煮酒 提交于 2019-12-11 16:10:12
问题 I am building a website in Laravel 4. I have a table in my DB called Games which contains a list of games. By default, I am sorting these Games with: $games = Game::orderBy('title', 'ASC')->paginate(20); Users can select which Games they are currently playing. These records are stored in a table called Players which stores game_id and user_id. A couple of relevant models I have created: class Game extends Eloquent { public function players() { return $this->hasMany('Player'); } } class User

Laravel Pivot Table and indirect relationship

痴心易碎 提交于 2019-12-11 14:57:53
问题 I'm writing a survey with Laravel 4 and need the ability for users to be able to take the same survey multiple times (and have their answers saved as different instances.) I currently have a pivot table called survey_user that links a user to an invited survey. A potentially positive side effect of the pivot table is that its primary key could be used to have unique survey instances. My problem is figuring out how to get answers, specifically through the user model. Answers table would

Querying Many to One to Relation in October CMS as a Join

蓝咒 提交于 2019-12-11 14:54:42
问题 Given the following October CMS Plugin Models: Schema::create('iaff106_cellphone_cellphones', function($table){ $table->engine = 'InnoDB'; $table->increments('id'); $table->integer('user_id')->unsigned()->nullable()->index(); $table->string('label'); $table->string('phone')->nullable()->index(); $table->integer('provider_id')->nullable(); $table->boolean('is_txtable')->default(true); $table->boolean('is_published')->default(false); $table->timestamps(); }); Schema::create('iaff106_cellphone

Why Twitter Bootstrap 2 btn-group doesn't work?

旧街凉风 提交于 2019-12-11 14:52:57
问题 Is there any possibility to make it work? Here's my code (I'm using it in a table): <div class="btn-group"> <td><a class="btn btn-mini btn-info" href="{{ URL::to('characters/{{ $player->name') }}">View</a></td> <td>{{ Form::open(array('method' => 'DELETE', 'route' => array('players.destroy', $player->id))) }} {{ Form::submit('Delete', array('class' => 'btn btn-mini btn-danger')) }} {{ Form::close() }}</td> </div> 回答1: simply give class="btn-group" to the <form> element: Try something like

How do I use includes in a laravel blade macro?

若如初见. 提交于 2019-12-11 14:48:59
问题 I am designing a back end for a site in Laravel 4. It will have a number of data entry forms, some of which will be broken up into tabbed pages. For an individual view it looks like this: <ul> <li id='menu0' class='menu active'>Main</li> <li id='menu1' class='menu'>Secondary</li> <li id='menu2' class='menu'>Advanced</li> </ul> <div id='tab0' class='tab active'> @include('_mainfields') </div> <div id='tab1' class='tab'> @include('_secondfields') </div> <div id='tab2' class='tab'> @include('

mime type validation in laravel 4 doesn't work

大城市里の小女人 提交于 2019-12-11 14:36:47
问题 I'm trying to validate the file size and the mime type of an uploaded file (mp3 file) in laravel. But the validation only seem to kick in when I upload an image (gif, png). When I upload an mkv file with a size of 100Mb the validation seems to be ok with it. Here's my current code: $file = Input::file('audio_file'); $file_rules = array('audio_file' => 'size:5242880|mimes:mp3'); //also tried mpeg $file_validator = Validator::make(Input::file(), $file_rules); if($file_validator->fails()){ /

Laravel redirection using withInput doesn't allow to change inputs values

我怕爱的太早我们不能终老 提交于 2019-12-11 14:03:46
问题 This is project from scratch, so if you want you can do exactly as I showed. I created the following migration just to create users table and add new record: public function up() { Schema::create('users', function ($table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->string('name', 60)->unique(); $table->string('email', 120)->unique(); $table->string('password', 256); $table->rememberToken(); $table->timestamps(); }); DB::table('users')->insert( [ [ 'name' => 'admin', 'email

Queue::later() not working on Laravel

我的梦境 提交于 2019-12-11 13:53:51
问题 I am studying Laravel framework and I am facing some problems with queues. Laravel provides a unified API to work with queues and I am taking a look into it. One of the methods that Laravel provides is Queue::later(DateTime|int $delay, string $job, mixed $data = '', string $queue = null); So, I implemented my job class: <?php class SendEmail { public function send($job, $data) { Log::info('JOB: ' . $job->getName()); Log::info('DATA: ' . $data['message']); } } Above, I log on a file, the

Laravel migration won't add foreign key with integer type (mysql)

元气小坏坏 提交于 2019-12-11 13:49:05
问题 I'm trying to add a foregin key which references an integer primary key in the reference table. I'm facing two issues with the way laravel is trying to create the table the first is that if I try to explicitly enter the foreign key columns integer length of 11 to match the reference column it thinks that I want this column as a primary key? And I get the error: "Incorrect table definition; there can only be one auto column and it must be defined as a key" Even if I explicitly state the