Questions tagged [laravel-controller]
218 questions
-2
votes
1 answer
How to get currently logged in user email from controller
I am trying to get the email of the currently logged in user from one of my controller. I normally get the currently logged in user id from this = auth()->id()
But when I try to get the email the same way like this = auth()->email() it gives me an…

Website Testing
- 11
- 3
-2
votes
1 answer
Having Laravel 8 routing and controller issue
Having Laravel 8 routing and controller issue
I'm bit new to laravel8 and got hang of it and I'm building a news portal as a project and learn at same time.
On the main index page I like to display some data such posts and categories and so on,…

Tahir D
- 1
- 3
-2
votes
1 answer
Undefined property: App\Http\Controllers\PostController::$p
my controller look like
public function react(Request $request){
//echo "hi";
//return;
//return response()->json($request);
$this->validate($request, [
'postid' => 'required',
'react' =>…

Aamir Khan
- 1
- 1
-2
votes
1 answer
How to retrieve Nested Relationship in Laravel View
I'm new to laravel, but learning along the way.. Now I have 3 Tables [ courses, units and lessons ]
Courses has multiple Units and each unit has multiple lessons
Database Tables look something like this :
courses
id
crs_name…

mahmoud
- 23
- 4
-2
votes
1 answer
Neither it show an error nor save the Data into my database PHP Laravel?
I am trying to insert data into the database neither it shows an error nor saves the data into my database below are the codes. here is the create blade php page .
@extends('layouts.app')
@section('content')