I want only use created_at , how to do it? I know: This can custom timestamps name This can disable timestamps Answer Eloquent does not provide such functionality out of the box, but you can create it on your own using the creating event callback:
Tag: laravel
Access denied for user ‘homestead’@’localhost’ (using password: YES)
I’m on a Mac OS Yosemite using Laravel 5.0. While in my local environment, I run php artisan migrate I keep getting : Access denied for user ‘homestead’@’localhost’ (using password: YES) …
Guzzle returns cURL error 3: malformed
I want to try out the guzzle library and am following through their quickstart tutorial to make http requests to an api. Yet it doesn’t seem to work, because I get the following error: Since I have never worked with cURL before, I don’t even know how to respond to that error message. Here is my code with the request
Laravel sort collection and then by key
I am making raking system for my users and here’s what I have so far: Get all users and sort them by points – it works fine. $users = User::all(); $users = $users->sortByDesc(function($item){ …
laravel 5 get current language id in controller
i’m new to laravel, and i’m wondering how to get the language_id (primary key “id” in database) by current lang_code (a column of language table). in my language model, i created a function like this …
Mocking classes that created with app()->make
I have this code in my __construrct: Now, when i’m unit testing i know that i can mock Guard and pass it’s mock to $auth, but how can i mock dbUserService ? it’s instantiated trough the IoC container. Answer You can use the instance() method of the IoC container to mock any class instanciated with make():
Php-ffmpeg “Unknown encoder libfaac” on Windows
I am using laravel 4.2. I am working on a project in that user can upload a video and I need to transcode it that it can be played over all kind of devices. For transcoding I have added php-ffmpeg package from git hub in my project. According to the instructions I have downloaded ffmpeg package from http://ffmpeg.zeranoe.com/builds and set
How to disable registration new users in Laravel
I’m using Laravel. I want to disable registration for new users but I need the login to work. How can I disable registration form/routes/controllers?
How to send mail after Laravel 5 default registration?
I’m noob in Laravel and working with Laravel 5. For user registration and and login, I want to use default system of laravel. But, need to extend it with two following features: User will get an …
How to join three table by laravel eloquent model
I have three table Articles table Categories table User table I want to show articles with their category name instead of category_id and user_name instead of user_id I try like these query It is work! But I want to do by Eloquent way. Please, how could I do? Answer With Eloquent it’s very easy to retrieve relational data. Check out