Questions tagged [laravel-5.3]

Laravel 5.3 is a past version of the open-source Model-View-Controller framework for PHP created by Taylor Otwell. It was released on August 23, 2016. Use it in addition to the laravel-5 tag if your question is specific to Laravel 5.3. Use the laravel tag for general laravel related questions.

Laravel 5.3 is a past version of the open-source Model-View-Controller framework for PHP created by Taylor Otwell. It was released on August 23, 2016.

What is new:

  • Notifications
  • WebSockets / Event Broadcasting
  • Laravel Passport (OAuth2 Server)
  • Search (Laravel Scout)
  • Mailable Objects
  • Storing Uploaded Files
  • Webpack & Laravel Elixir
  • Frontend Structure
  • Routes Files
  • Closure Console Commands
  • The $loop Variable

Resources:

4266 questions
150
votes
14 answers

laravel 5.3 new Auth::routes()

Recently I start to use laravel 5.3 to write a blog, but I have a question after run php artisan make:auth when I run this, it will generate routes in my web.php this is the code in it: Auth::routes(); Route::get('/home',…
g1eny0ung
  • 1,761
  • 3
  • 14
  • 17
111
votes
12 answers

What is the best practice for adding constants in laravel? (Long List)

I am rather new to laravel. I have a basic question, What is the best way to add constants in laravel. I know the .env method that we use to add the constants. Also I have made one constants file to use them for my project. For…
Faran Khan
  • 1,495
  • 4
  • 14
  • 26
103
votes
2 answers

How to use API Routes in Laravel 5.3

In Laravel 5.3 API routes were moved into the api.php file. But how can I call a route in api.php file? I tried to create a route like this: Route::get('/test',function(){ return "ok"; }); I tried the following URLs but both returned the…
user964843
90
votes
17 answers

Adding Access-Control-Allow-Origin header response in Laravel 5.3 Passport

I'm new to Laravel and am doing some Laravel 5.3 Passport project with OAuth2.0 password grant. When I curl the API with the params it responds with token. However, in browser it needs an additional security that the endpoint should add because my…
user3856437
  • 2,071
  • 4
  • 22
  • 27
74
votes
3 answers

Eloquent: find() and where() usage laravel

I am trying to get a record from a posts database table using its id. I've been banging my head on the find() method for quite sometime now, confused as to why it wasn't working. Here is my query that looks correct to me but didn't work: $post =…
Awa Melvine
  • 3,797
  • 8
  • 34
  • 47
74
votes
13 answers

Laravel Passport Key path oauth-public.key does not exist or is not readable

Laravel passport showing this while trying to access resource Key path "file://C:\xampp\htdocs\rental_5.0\storage\oauth-public.key" does not exist or is not readable
Sabri Aziri
  • 4,084
  • 5
  • 30
  • 45
65
votes
20 answers

How to set laravel 5.3 logout redirect path?

Is there no elegant solution to redirect to a specific page after logging out in Laravel 5.3? The function being called is from the trait AuthenticatesUsers: public function logout(Request $request) { $this->guard()->logout(); …
Tim van Uum
  • 1,873
  • 1
  • 17
  • 36
62
votes
3 answers

How to make a Trait in Laravel

Where to make the file if i want to use this trait on my Models How should this file look like if i want to have this trait inside: trait FormatDates { protected $newDateFormat = 'd.m.Y H:i'; // save the date in UTC format in DB table …
lewis4u
  • 14,256
  • 18
  • 107
  • 148
57
votes
4 answers

Laravel 5.3 date validator: equal to or after start_date

I'm using Laravel 5.3 to validate start_date and end_date for an event. end_date should be equal to start_date or the after date. end_date >= start_date $validator = Validator::make($data, [ 'start_date' => 'required|date', 'end_date' …
Paul Z.
  • 855
  • 1
  • 10
  • 27
57
votes
7 answers

Missing routes.php File in New Laravel Project

I downloaded Composer, installed Laravel, and started my first Laravel project to begin learning Laravel using the lessons on laracast (great lessons). Lesson two covers routes. My new project does not have a routes.php file. I deleted composer and…
T.A.
  • 638
  • 1
  • 6
  • 15
53
votes
8 answers

Group by not working - Laravel

I'm not able to run this simple query in Laravel 5.3 $top_performers = DB::table('pom_votes') ->groupBy('performer_id') ->get(); It gives me: SQLSTATE[42000]: Syntax error or access violation: 1055 'assessment_system.pom_votes.id'…
Parth Vora
  • 4,073
  • 7
  • 36
  • 59
52
votes
2 answers

Laravel 5.3 Notification Vs Mailable

I am a little confused about whether to use Laravel's Notification or Mailable class. From what I understand, Mailables are used to send only emails whereas Notifications can be used to send emails and sms. In my application, I dont have plans to…
Neel
  • 9,352
  • 23
  • 87
  • 128
49
votes
16 answers

How can I solve incompatible with sql_mode=only_full_group_by in laravel eloquent?

My laravel eloquent is like this : $products = Product::where('status', 1) ->where('stock', '>', 0) ->where('category_id', '=', $category_id) ->groupBy('store_id') ->orderBy('updated_at', 'desc') …
samuel toh
  • 6,836
  • 21
  • 71
  • 108
49
votes
2 answers

Laravel 5.3 Validation Fails when Variables are Null

Since upgrading laravel from 5.1 to 5.3, I've got couple of odd issues with Validation. When I post a data like this: firstName null And the validation rules are like this: $validator = Validator::make($postData, [ 'firstName' …
Neel
  • 9,352
  • 23
  • 87
  • 128
45
votes
10 answers

How to set and get Cookie in laravel

I would like to set and get value in cookie but it doesn't work: Cookie::queue('online_payment_id', "1", 15); $value = Cookie::get('online_payment_id'); dd($value); dd() returns null; I used below way but I got this message: Method…
S.M_Emamian
  • 17,005
  • 37
  • 135
  • 254
1
2 3
99 100