Desssha

Member Since 3 Months Ago

Moscow

Experience Points
1,230
Total
Experience

3,770 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
1
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 1
1,230 XP
Apr
24
2 weeks ago
Activity icon

Awarded Best Reply on Unlink(202104241126Dell_Logo.png): No Such File Or Directory

thxs man . for tying help . i use your cod but not help also but there was little edit in code and it worked . just edit Path between " " . maybe it will help someone else . public function deleteBrand($request){

    $deletelogo = $this->brandyModel::where('id',$request->id)->first();

    $path = public_path("upload/brands/$deletelogo->logo");
    if (is_file($path)){
    unlink($path);
    }

    $deletelogo->delete();
    $notificat = array(
        'message' => 'Brand Deleted Successfully',
        'alert-type' => 'success',
    );
    return redirect()->back()->with($notificat);
}
Activity icon

Replied to Unlink(202104241126Dell_Logo.png): No Such File Or Directory

thxs man . for tying help . i use your cod but not help also but there was little edit in code and it worked . just edit Path between " " . maybe it will help someone else . public function deleteBrand($request){

    $deletelogo = $this->brandyModel::where('id',$request->id)->first();

    $path = public_path("upload/brands/$deletelogo->logo");
    if (is_file($path)){
    unlink($path);
    }

    $deletelogo->delete();
    $notificat = array(
        'message' => 'Brand Deleted Successfully',
        'alert-type' => 'success',
    );
    return redirect()->back()->with($notificat);
}
Activity icon

Replied to Unlink(202104241126Dell_Logo.png): No Such File Or Directory

not help was try before the same not delete photo

Activity icon

Replied to Unlink(202104241126Dell_Logo.png): No Such File Or Directory

public = laravel/public/upload/brands. sorry was mistak.

Activity icon

Started a new Conversation Unlink(202104241126Dell_Logo.png): No Such File Or Directory

this function delete Brand but photo still save in folder inside public/upload/brands/

i want when make delete it remove photo from folder also.

public function deleteBrand($request){

    $deletelogo = $this->brandyModel::where('id',$request->id)->first();

    $logo = $deletelogo->logo;
    if (is_file($logo)){
    unlink(public_path('upload/brands'.$logo));
    }
    $deletelogo->delete();
    $notificat = array(
        'message' => 'Brand Deleted Successfully',
        'alert-type' => 'success',
    );
    return redirect()->back()->with($notificat);
}
Apr
20
3 weeks ago
Activity icon

Replied to The GET Method Is Not Supported For This Route. Supported Methods: POST. Http://127.0.0.1:8000/admin/delete/categories/2

thxs man for every one try to help . my work was right . but problem was in route . i use it

php artisan optimize:clear

it help me .

was use it before but not help php artisan optimize .

/

Activity icon

Replied to The GET Method Is Not Supported For This Route. Supported Methods: POST. Http://127.0.0.1:8000/admin/delete/categories/2

i have sweet alert how can pass id i want delete . and how can solve this error get&post

Activity icon

Replied to The GET Method Is Not Supported For This Route. Supported Methods: POST. Http://127.0.0.1:8000/admin/delete/categories/2

i build dashboard for admin to add , edit and delete category . i show category for admin and in table icon link t delete category or delete . how can do it without form with sweet alert

Activity icon

Replied to The GET Method Is Not Supported For This Route. Supported Methods: POST. Http://127.0.0.1:8000/admin/delete/categories/2

so in my case now i use table for admin and from this take want make link for edit and delete with sweet alert how can do it . thxs for help

Apr
19
3 weeks ago
Activity icon

Replied to The GET Method Is Not Supported For This Route. Supported Methods: POST. Http://127.0.0.1:8000/admin/delete/categories/2

i was do the same in another project and it worked ok but now i don't know why not work and give this error .

can take a look in old project . admin->exam controller and view ->admin-> exam-> index and rout https://github.com/Moustafa-desha/skillshub

Activity icon

Replied to The GET Method Is Not Supported For This Route. Supported Methods: POST. Http://127.0.0.1:8000/admin/delete/categories/2

in index.blade i have table and in table Action from action can edit or delete this category so i not need to make it form .

Activity icon

Started a new Conversation The GET Method Is Not Supported For This Route. Supported Methods: POST. Http://127.0.0.1:8000/admin/delete/categories/2

i use post and give me this error

my Route Route::POST('admin/delete/categories/{id}',[CategoryController::class,'deleteCat']); my CategoryRepository

public function deleteCat($request){ $validator = Validator::make($request->all(),[ 'cat_id' => 'required|exists:categories,id', ]); if ($validator->fails()){ return redirect()->back()->withErrors($validator)->withInput($request->all()); }

   $this->categoryModel::where('id',$request->id)->delete();

    $notificat = array(
        'message' => 'Category deleted Successfully',
        'alert-type' => 'success'
    );
   return redirect()->back()->with($notificat);
}

my blade

                      @extends('admin.admin_master')

@section('admin')

<!-- ########## START: MAIN PANEL ########## -->

    <div class="sl-pagebody">
        <div class="sl-page-title">
            <h5>Category list</h5>
        </div><!-- sl-page-title -->

        <div class="card pd-20 pd-sm-40">
            <h6 class="card-body-title">Category Table
                <a href="" class="btn btn-sm btn-success" style="float: right;" data-toggle="modal" data-target="#modaldemo3">Add New</a>

            </h6>

            <div class="table-wrapper">
                <div id="datatable1_wrapper" class="dataTables_wrapper no-footer"><div class="dataTables_length" id="datatable1_length">
                        <label><select name="datatable1_length" aria-controls="datatable1" class="select2-hidden-accessible" tabindex="-1" aria-hidden="true">
                                <option value="10">10</option><option value="25">25</option><option value="50">50</option>
                                <option value="100">100</option></select><span class="select2 select2-container select2-container--default" dir="ltr" style="width: 48px;">
                                <span class="selection"><span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-labelledby="select2-datatable1_length-qg-container">
                                <span class="select2-selection__rendered" id="select2-datatable1_length-qg-container" title="10">10</span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span></span></span>
                                <span class="dropdown-wrapper" aria-hidden="true"></span></span> items/page</label></div><div id="datatable1_filter" class="dataTables_filter"><label><input type="search" class="" placeholder="Search..." aria-controls="datatable1"></label></div>
                    <table id="datatable1" class="table display responsive nowrap dataTable no-footer dtr-inline" role="grid" aria-describedby="datatable1_info" style="width: 987px;">
                        <thead>
                        <tr>
                            <th class="wd-15p">ID</th>
                            <th class="wd-15p">Category name</th>
                            <th class="wd-20p">Action</th>

                        </tr>
                        </thead>
                         <tbody>
                            @foreach($categories as $category)
                        <tr role="row" class="odd">
                            <td tabindex="0" class="sorting_1">{{ $category->id }}</td>
                            <td>{{ $category->name }}</td>
                            <td>
                                <a href="" class="btn btn-sm btn-info">edit</a>
                                <a href="{{ url('admin/delete/categories/'.$category->id) }}" class="btn btn-sm btn-danger" id="delete">delete</a>
                            </td>

                        </tr>
                            @endforeach
                         </tbody>
                    </table>
                    <div class="dataTables_info" id="datatable1_info" role="status" aria-live="polite"></div>
                    <div class="dataTables_paginate paging_simple_numbers" id="datatable1_paginate">
                        <a class="paginate_button previous disabled" aria-controls="datatable1" data-dt-idx="0" tabindex="0" id="datatable1_previous">Previous</a>
                        <span><a class="paginate_button current" aria-controls="datatable1" data-dt-idx="1" tabindex="0">1</a></span>
                        <a class="paginate_button next" aria-controls="datatable1" data-dt-idx="7" tabindex="0" id="datatable1_next">Next</a>
                    </div>
                </div>
            </div><!-- table-wrapper -->
        </div>
        <!-- card -->
<!-- ########## END: MAIN PANEL ########## -->

<!-- LARGE MODAL -->
<div id="modaldemo3" class="modal fade">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content tx-size-sm">
            <div class="modal-header pd-x-20">
                <h6 class="tx-14 mg-b-0 tx-uppercase tx-inverse tx-bold">Add New Category</h6>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body pd-20">
                <form class="row g-3 row justify-content-center"  method="POST" action="{{ route("add.category") }}">
                    @csrf

                    <div class="col-md-8">
                        <label for="cat_name" class="form-label">Category Name</label>
                        <input type="text" class="form-control" name="name"  id="cat_name" placeholder="Category">
                        @error('name')
                        <div class="text-danger">{{ $message }}</div>
                        @enderror
                    </div>

               </div><!-- modal-body -->
            <div class="modal-footer">
                <button type="submit" class="btn btn-info pd-x-20">Save</button>
                <button type="button" class="btn btn-secondary pd-x-20" data-dismiss="modal">Close</button>
            </div>
            </form>
        </div>
    </div><!-- modal-dialog -->
</div><!-- modal -->

@endsection

Activity icon

Replied to Symfony\Component\Routing\Exception\RouteNotFoundException Route [store.category] Not Defined. (View: D:\xampp\htdocs\Ecommerce_Laravel8\resources\views\admin\category\index.blade.php)

php artisan optimize also do the same .

it somthing like it

  • Edit Profile
  • Password Change
  •                     <li><a href=""><i class="icon ion-ios-gear-outline"></i> Settings</a></li>
                        <li><a href=""><i class="icon ion-ios-download-outline"></i> Downloads</a></li>
                        <li><a href=""><i class="icon ion-ios-star-outline"></i> Favorites</a></li>
                        <li><a href=""><i class="icon ion-ios-folder-outline"></i> Collections</a></li>
                        <li><a href="{{ route('admin.logout') }}"><i class="icon ion-power"></i> Sign Out</a></li>
                    </ul>
                </div><!-- dropdown-menu -->
    

    so it frontend not back

Apr
18
3 weeks ago
Activity icon

Started a new Conversation Symfony\Component\Routing\Exception\RouteNotFoundException Route [store.category] Not Defined. (View: D:\xampp\htdocs\Ecommerce_Laravel8\resources\views\admin\category\index.blade.php)

Symfony\Component\Routing\Exception\RouteNotFoundException Route [store.category] not defined. (View: D:\xampp\htdocs\Ecommerce_Laravel8\resources\views\admin\category\index.blade.php)

i got this erorr always with route in blade page . but if i stop server and make php artisan optimize and after it make ctrl+f5 in browser this error disappear so why i got it and any solve for it please ?

Apr
14
4 weeks ago
Activity icon

Replied to Can't Change Password . Password Not Match .

it true fix it but now another problem update password but not make logout . Auth not make logout . it back me to dashboard and should redirect me to admin login *****

Auth not work so i solve it by use redirect to(admin. logout)

    $admin->password = Hash::make($request->password);
    $admin->save();
    Auth::logout();
    return redirect()->route('admin.logout');
Activity icon

Replied to Can't Change Password . Password Not Match .

Error Class "App\Http\Repositories\Password" not found

try another way last night give me the same error don't know why

Activity icon

Replied to Can't Change Password . Password Not Match .

is not solve problem . still same error . problem not match old password with password in data base . because toaster worke

Activity icon

Started a new Conversation Can't Change Password . Password Not Match .

say password not match and back me again .

i do it before in users table and it work perfect but with admin table it not work . i use multi Auth jetstrem

public function updatePassword($request)
{
    $validation = $request->validate([
        'oldpassword' =>'required',
        'password' => 'required|confirmed|min:6',
        'password_confirmation' => 'required',
    ]);

    $admin = Admin::find(1);
    if (!Hash::check($request->oldpassword,$admin->password)){
        $notificat = array(
            'message' => 'password not match',
            'alert-type' => 'error',
        );
        return redirect()->back()->with($notificat);
    }
    $admin->password = Hash::make($request->password);
    $admin->save();
    Auth::logout();

    return redirect()->route('admin.login');

} // End Method
Apr
13
1 month ago
Activity icon

Started a new Conversation Attempt To Read Property "id" On Null .

some time i got this error and dissappears again when i make artisan optimize and also for browser . how can solve it please

Ecommerce_Laravel8\app\Http\Repositories\UserRepository.php:32

namespace App\Http\Repositories;

use App\Http\Interfaces\UserInterface; use App\Models\User; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash;

class UserRepository implements UserInterface {

private $userModel;

public function __construct(User $user){

    $this->userModel = $user;
}  //end Method


public function logout()
{
    Auth::logout();
    return redirect()->route('login');
}  //end Method

public function profile()
{
    $id = Auth::user()->id;
    $user = $this->userModel::find($id);

    return view('user.profile.view_profile',compact('user'));
}  //end Method
Activity icon

Started a new Conversation Attempt To Read Property "id" On Null .

some time i got this error and dissappears again when i make artisan optimize and also for browser . how can solve it please

Ecommerce_Laravel8\app\Http\Repositories\UserRepository.php:32

namespace App\Http\Repositories;

use App\Http\Interfaces\UserInterface; use App\Models\User; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash;

class UserRepository implements UserInterface {

private $userModel;

public function __construct(User $user){

    $this->userModel = $user;
}  //end Method


public function logout()
{
    Auth::logout();
    return redirect()->route('login');
}  //end Method

public function profile()
{
    $id = Auth::user()->id;
    $user = $this->userModel::find($id);

    return view('user.profile.view_profile',compact('user'));
}  //end Method
Apr
12
1 month ago
Activity icon

Replied to Syntax Error, Unexpected End Of File

your answer helped me to know why get this error . thxs a lot man

Apr
09
1 month ago
Activity icon

Replied to Unable To Prepare Route [logout] For Serialization.

your answer help me thxs a lot

Apr
02
1 month ago
Activity icon

Replied to Laravel 8 Jetstream - Vue Error

i have same problem . just move Route under (inside) Auth and try show another problem . back Route again like before try worked . hahahha i don't understand what was problem or where

Mar
11
2 months ago
Activity icon

Replied to ErrorException: Attempt To Read Property &quot;roleName&quot; On Null In File

i already register it in kernel.php . when i use admin everthing work good but if secertary or support can't do anyting

Activity icon

Replied to ErrorException: Attempt To Read Property &quot;roleName&quot; On Null In File

i make rout when i login as dmin and send token in postman it work without problem but if login as support and and send token and try make update or anything show me this error

Activity icon

Started a new Conversation ErrorException: Attempt To Read Property &quot;roleName&quot; On Null In File

ErrorException: Attempt to read property "roleName" on null in file

C:\xampp\htdocs\eraasoftBackendWorkshop\app\Http\Middleware\Roles.php on line 24

i make rout when i login as admin and send token in postman it work without problem but if login as support or secretary and and send token and try make update or anything show me this error

and this my middleware

namespace App\Http\Middleware;

use App\Http\Traits\ApiDesignTrait;

use Closure;

use Illuminate\Http\Request;

use ApiResponse;

class Roles { use ApiDesignTrait;

/**

 * Handle an incoming request.
 *
 * @param  \Illuminate\Http\Request  $request

 * @param  \Closure  $next

 * @return mixed

/* */

public function handle(Request $request, Closure $next, $roles)
{
    $userRole = auth()->user()->roleName->name;


    $allowUser = explode ('.',$roles);

    if(!in_array($userRole , $allowUser)){

        return $this->ApiResponse(422,' OOPS Not Allow for you not your Job');
    }
    return $next($request);
}

}

Activity icon

Replied to Middleware Problem

thxs i update it now is show. hope u can help

Activity icon

Replied to Middleware Problem

are my code is show ? i can't see only title i see!

Activity icon

Started a new Conversation Middleware Problem

ErrorException: Attempt to read property "roleName" on null in file

C:\xampp\htdocs\eraasoftBackendWorkshop\app\Http\Middleware\Roles.php on line 24

and this my middleware

namespace App\Http\Middleware;

use App\Http\Traits\ApiDesignTrait;

use Closure;

use Illuminate\Http\Request;

use ApiResponse;

class Roles { use ApiDesignTrait;

/**

 * Handle an incoming request.
 *
 * @param  \Illuminate\Http\Request  $request

 * @param  \Closure  $next

 * @return mixed

/* */

public function handle(Request $request, Closure $next, $roles)
{
    $userRole = auth()->user()->roleName->name;


    $allowUser = explode ('.',$roles);

    if(!in_array($userRole , $allowUser)){

        return $this->ApiResponse(422,' OOPS Not Allow for you not your Job');
    }
    return $next($request);
}

}

Feb
13
3 months ago
Activity icon

Awarded Best Reply on Can't Upload Repository To Github

thanks for everyone try to help . i solved it and it worked

https://docs.github.com/en/github/using-git/changing-a-remotes-url

but before it i was clear cach and sing out from git

after change link use it

git push -u origin main

Activity icon

Replied to Can't Upload Repository To Github

thanks for everyone try to help . i solved it and it worked

https://docs.github.com/en/github/using-git/changing-a-remotes-url

but before it i was clear cach and sing out from git

after change link use it

git push -u origin main

Activity icon

Replied to Can't Upload Repository To Github

when i use $ git remote set url origin https://github.com/Moustafa-desha/skillshub.git error: Unknown subcommand: set usage: git remote [-v | --verbose] or: git remote add [-t ] [-m ] [-f] [--tags | --no-tags] [--mirror=<fetch|push>] or: git remote rename or: git remote remove or: git remote set-head (-a | --auto | -d | --delete | ) or: git remote [-v | --verbose] show [-n] or: git remote prune [-n | --dry-run] or: git remote [-v | --verbose] update [-p | --prune] [( | )...] or: git remote set-branches [--add] ... or: git remote get-url [--push] [--all] or: git remote set-url [--push] [] or: git remote set-url --add or: git remote set-url --delete

-v, --verbose         be verbose; must be placed before a subcommand

what should i use ?

Activity icon

Replied to Can't Upload Repository To Github

i tried it but not help anyway

Activity icon

Started a new Conversation Can't Upload Repository To Github

when i try upload show me this message

$ git remote add origin https://github.com/Moustafa-desha/skillshub.git

error: remote origin already exists.

after when i make push

git push -u origin main

show me this error

$ git push -u origin main

[email protected]: Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

Feb
12
3 months ago
Activity icon

Started a new Conversation Pusher Event Not Work When I Active It With Some Event In Site

pusher work if i test it for just test but when i active it for added new exam not work .

i make event class ExamAddedEvent implements ShouldBroadcast .

and this code.

   public function broadcastOn()
{
    return ['notifications-channel'];
}

public function broadcastAs()
{
    return 'exam-added';
}

my layout .

   <script src="https://js.pusher.com/7.0/pusher.min.js"></script>

	<script>
		
		// Enable pusher logging - don't include this in production
		Pusher.logToConsole = true;

		var pusher = new Pusher('99257b25d6fbd6f11efc', {
		cluster: 'eu'
		});

		var channel = pusher.subscribe('notifications-channel');
		channel.bind('exam-added', function(data) {
			alert(JSON.stringify(data));
				toastr.success('New Exam Added!')
		});
	</script>

toastr msdn i use css and js in layout and it work if i move ( toastr.success('New Exam Added!') )

in another it work when i make reload for page but it not work when i add new exam

this my Examcontroller

$exam->update([
                            'active' => 1,
                    ]);


                //    هنا هنفعل البوشر عن طريق ميسود الايفنت واسم الايفنت اللى انشاناه
                    event(new ExamAddedEvent);

                    return redirect( url("dashboard/exams") );
                }

why it not work ?

.env everything ok copy past without change .

Feb
06
3 months ago
Activity icon

Replied to Laravel 8 , 419 PAGE EXPIRED

yeeeees man thxs a lot 2 days i search and looking in code .

Activity icon

Replied to Laravel 8 , 419 PAGE EXPIRED

which line code now show i don't know why

Activity icon

Started a new Conversation Laravel 8 , 419 PAGE EXPIRED

when i try make update for skills it show me this page but delete and add new work this controller

Jan
18
3 months ago
Activity icon

Replied to Integrity Constraint Violation: 1451 Cannot Delete Or Update A Parent Row: A Foreign Key Constraint Fails

yes relation was one-to-many because it detach() wasn't work .

Activity icon

Replied to Integrity Constraint Violation: 1451 Cannot Delete Or Update A Parent Row: A Foreign Key Constraint Fails

thxs man it worked with me. was trying some method like it but not worked $room=Room::find($id); $room->bookings()->detach(); $room>delete(); but your method work thxs

Activity icon

Started a new Conversation Integrity Constraint Violation: 1451 Cannot Delete Or Update A Parent Row: A Foreign Key Constraint Fails

excuse me how can delete i try use of of this method but not successful

1- $room_info = Room::where("id", $id)->delete();

2-  DB::table('rooms')->where('id',$id)->delete();

i understand that Rooms have foreign in bookings what best method to delete it with foreign key. thxs

Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (hotelbooking.bookings, CONSTRAINT bookings_room_id_foreign FOREIGN KEY (room_id) REFERENCES rooms (id)) (SQL: delete from rooms where id = 3) in file

Jan
17
3 months ago
Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

thankssssssssssss man you are the best omg one day in this problem. it work man yeaaahh thanks alote. sorry i am new in laravel .

Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

when i used second give me this error ErrorException: Trying to get property 'id' of non-object in file C:\xampp\htdocs\

Activity icon

Replied to ErrorException: Trying To Get Property 'id' Of Non-object In File C:\xampp\htdocs\hotelbooking\app\Http\Controllers\ApiHotelController.php On Line 85

like you see in error Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'user_id' cannot be null (SQL: insert into bookings (room_id, user_id, date_start, date_end, booking_number, updated_at, created_at) values (1, ?, 2021-1-18, 2021-1-20, 8475498, 2021-01-17 20:04:41, 2021-01-17 20:04:41)) in file

insert everything only user_id ? in vlues