laravel-4

Why am I always logged in even after closing browser with remember me set to false

时光总嘲笑我的痴心妄想 提交于 2019-12-25 05:50:44
问题 I've creating a working user/login system with the laravel 4 framework and all is working well. However I'm always logged into the site unless I run the logout process. I would assume that if I login, close all browser windows and open the browser again I would be logged out. This is not the case. In my Auth::attempt I am setting the $remember parameter to false even though it is false by default. I have no idea why this is happening. If I logout, close all my browser windows then open them

Laravel - many-to-many where the many-to-many table is (part-) polymorph

两盒软妹~` 提交于 2019-12-25 05:45:47
问题 I have a table called bonus. A user can get a bonus (it's like an reward) for certain actions. Well, the bonus can be assigned to many users and many users can get the same bonus. So it's a many to many relation between user and bonus. This is no problem so far. But users can get the same bonus for different actions. So let's say there is a bonus for voting on a picture. Well, one user could vote on one picture and another one could vote on another picture which I'd like to save in the many

retrieving multiple records associated to multiple records laravel 4.2

我与影子孤独终老i 提交于 2019-12-25 05:34:15
问题 recently i asked this question which got one answer but unfortunately didn't solve the problem, after that i got no more answers and i really need to fix this problem i have. Alright so i have to make a quiz website for my school in which a user should be able to play the quiz, this page need to show the quiz name, the questions associated to the quiz and the answers associated to the questions. I can show the quiz name no problem and i can show the questions aswell, but for some reason only

Submit Multiple Select Values to an Action in Laravel 4

自作多情 提交于 2019-12-25 05:25:47
问题 I've been trying to figure out how to submit multiple multi-select values using a redirect or something similar to an index() method/action in my resource controller in Laravel 4. I've made several attempts to achieve this but have yet to work out how to do it. I initially had it submitting to a query string, which worked to a certain extent but as soon as you selected more than 1 value in a single multi-select box, it wouldn't work, as it simply chose to use the last value. This is the form

laravel eager loading to minimize queries

妖精的绣舞 提交于 2019-12-25 05:12:15
问题 I am using laravel with DDD Pattern and here is my code to make some analytics report for website... My code from Repository... //Abstract Entity public function getFirstBy($key, $value, array $with = array()) { return $this->repository->getFirstBy($key, $value, $with); } //Link Entity $link = parent::getFirstBy('hash', $data['hash'], ['visits']); //prepare report $report = []; //get dates difference $date1 = new \DateTime($data['from']); $date2 = new \DateTime($data['to']); $date_diff =

Creating new data using POST dosen't work in laravel 5

依然范特西╮ 提交于 2019-12-25 04:49:28
问题 I've got a problem moving from laravel 4 to laravel 5. I hae a test example that i downloadet some time ago in laravel 4 and it works prefectly. But when i wrote the same example it stops at some point. I'm using ExtJS 5 for framework. Controller: <?php namespace App\Http\Controllers\books; use App\Http\Requests; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class BookController extends Controller { public function load() { $books = DB::table('books')->select('id','title',

PHP GD (intervention/image) : quality is different depending on the server

有些话、适合烂在心里 提交于 2019-12-25 04:26:11
问题 I use the intervention/image library (which use GD) for my Laravel 4.1 project to resize some images (jpg and png). Everything is great on dev server, but in production, the quality of the thumbnails is very poor. I thought it was a GD problem, but here are the installed versions, and they look similar to me: dev : OSX Mavericks, php 5.4.19 GD Support : enabled GD Version : bundled (2.1.0 compatible) FreeType Support : enabled FreeType Linkage : with freetype FreeType Version : 2.4.10 T1Lib

How to avoid directory listing in laravel 4

瘦欲@ 提交于 2019-12-25 04:13:07
问题 I am new to Laravel4, I was trying to run laravel4 on a shared hosting.Since I dont have root access, to avoid public in my url. I have moved all the contents in the public directory to "public_html" folder. Then I changed the locations in respective files. But when I visited url "abc.com/myapp/app", it lists all the folders and files under app directory. Since it exposes the project files, I was looking to avoid the same. In CodeIgniter if we try to access folders like this it gives message

Using different Table for Authentication in Laravel

萝らか妹 提交于 2019-12-25 04:07:37
问题 I tried with the default user table for Laravel Auth purpose, Now i am changing it to the admin Table So i refereed here Accordingly i tried to change the Table name as admin in the auth.php 'model' => 'User', 'table' => 'users', to 'model' => 'AdminModel', 'table' => 'admin', And in the AdminModel i have protected $table = 'admin'; And i got the error Class AdminModel contains 6 abstract methods and must therefore be declared abstract or implement the remaining methods (Illuminate\Auth

Passing data from view to controller in Laravel

巧了我就是萌 提交于 2019-12-25 04:01:09
问题 I understand that passing record ids through the url isn't usually a good idea, but I am wondering how I can avoid it in my case: My objective is to list job statuses on a user dashboard and allow users to adjust the status. I create my view and pass variables to it using the session: userController.php public function getdashboard() { //reading the user information $arrPageData['user'] = Sentry::getUser(); //reading the job interviews $arrPageData['jobInterviews'] = JobInterview: