Questions tagged [laravel-5.1]

Laravel 5.1 is a past version of the open-source PHP web framework. It has been released on 9th June 2015. Use it in addition to the laravel-5 tag if your question is specific to Laravel 5.1. Use the laravel tag for general laravel related questions.

Laravel 5.1 is a past version of Laravel 5. It has been released on 9th June 2015.

What is new:

  • LTS (Long Term Support)
  • PSR-2 compliance
  • Event broadcasting
  • Middleware parameters
  • Model factories
  • Overhauled testing with new helper traits and a new expressive fluent interface for integration tests
  • Blade service injection
  • Artisan improvements for simplified command signatures and advanced output forms
  • CSRF whitelisting
  • Laravel Envoy allows you to run local scripts without SSH
  • Laravel Elixir compiles ECMAScript 6 by default
  • Backwards-compatible folder structure changes
  • Completely overhauled documentation
  • 5.1.4: Authentication throttling
  • 5.1.11: ACL (Access Control List) authorization

Resources:

4654 questions
118
votes
14 answers

laravel 5 : Class 'input' not found

In my routes.php file I have : Route::get('/', function () { return view('login'); }); Route::get('/index', function(){ return view('index'); }); Route::get('/register', function(){ return…
Gammer
  • 4,655
  • 13
  • 58
  • 100
86
votes
3 answers

How to execute raw queries with Laravel 5.1?

So I have this tiny query to run on my DB and it works fine in MySQL Workbench. Basically, a SELECT with LEFT JOIN and UNION with LEFT JOIN again. SELECT cards.id_card, cards.hash_card, cards.`table`, users.name, 0 as total, …
Sandro Wiggers
  • 3,578
  • 2
  • 14
  • 22
84
votes
5 answers

Laravel 5 Application Key

I am new to Laravel. I just started it tonight. Actually, I have the following code: 'key' => env('APP_KEY', 'SomeRandomString'), In xampp/htdocs/laravel/blog/config/app.php. I want to change this key to 32-bit by cmd…
Raham
  • 4,141
  • 3
  • 21
  • 26
80
votes
11 answers

Get only records created today in laravel

How do I use the created_at field to get only the records that were created today and no other day or time? I was thinking of a ->where('created_at', '>=', Carbon::now()) But Im not sure that would work.
TheWebs
  • 10,087
  • 21
  • 77
  • 164
67
votes
3 answers

Carbon Difference in Time between two Dates in hh:mm:ss format

I'm trying to figure out how I can take two date time strings that are stored in our database and convert it to a difference in time format of hh:mm:ss. I looked at diffForHumans, but that does give the format I'd like and returns things like after,…
mtpultz
  • 13,197
  • 18
  • 96
  • 180
60
votes
3 answers

Convert String to Carbon

I am using Laravel 5.1 Few days ago I used protected $dates = ['license_expire'] in my model to convert the string date to Carbon instances. In HTML the default value in create form for the date was Carbon\Carbon::now()->format('Y-m-d') In order to…
smartrahat
  • 4,455
  • 5
  • 39
  • 62
59
votes
5 answers

Laravel : How to Log INFO to separate file

How to specify a separate file for logging INFO in Laravel 5.1? Any immediate help will be highly appreciable. Thanks
Rohit Jindal
  • 11,704
  • 11
  • 56
  • 92
58
votes
1 answer

Go back URL in Laravel 5.1

How can I get the previous URL visited on the website in Laravel 5.1? In Laravel 4 I just needed to write it like below: {{ URL::previous() }}
Linus Odenring
  • 751
  • 1
  • 7
  • 9
57
votes
6 answers

Fatal error while upgrading Laravel 5.1 to 5.2

I'm following the official upgrade guide from 5.1 to 5.2. First sub-section says: If you are installing a beta release of Laravel 5.2, add "minimum-stability": "beta" to your composer.json file. Update your composer.json file to point to…
lesssugar
  • 12,977
  • 15
  • 52
  • 95
54
votes
5 answers

Create a Laravel Request object on the fly

I'm handling data in one controller and want to pass it further into another controller to avoid duplicate code. Is there a way to set up a Request object that is needed in the other controller's store-method? I've traced down the Request…
Ben Fransen
  • 10,136
  • 16
  • 67
  • 123
52
votes
9 answers

getting error while updating Composer

I have a project in Laravel-5.1 and I have changed my platform from win10 to Ubuntu. Showing error: Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an…
Ketan Akbari
  • 8,937
  • 5
  • 29
  • 51
52
votes
3 answers

disable csrf in laravel for specific route

I've a payment system, where data is submitted to 3rd party site and than hauled back... When data returns it hits specific url lets say /ok route. $_REQUEST['transaction']. But because of laravel middleware I'm getting token mismatch. There is no…
user796443
50
votes
4 answers

How to clear Route Caching on server: Laravel 5.2.37

This is regarding route cache on localhost About Localhost I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below. if I comment any one route in my…
Pankaj
  • 8,971
  • 23
  • 105
  • 242
47
votes
4 answers

How to check if row is soft-deleted in Eloquent?

In Laravel 5.1 is there a nice way to check if an eloquent model object has been soft-deleted? I'm not talking about selecting data but once I have the object e.g. Thing::withTrashed()->find($id) So far the only way I can see is if…
DisgruntledGoat
  • 62,693
  • 62
  • 192
  • 281
44
votes
4 answers

How to capitalize first letter in Laravel Blade

I'm using laravel (5.1) blade template engine with the localization feature. There is a language file messages.php within the /resources/lang/en/ folder: return [ 'welcome' => 'welcome', In my blade template the welcome message is called using…
user947668
  • 2,071
  • 5
  • 33
  • 51
1
2 3
99 100