me10071990

me10071990

Software Engineer at Learner

Member Since 7 Months Ago

Budapest Hungary

Experience Points
4,010
Total
Experience

990 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
4
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

Level 1
4,010 XP
Dec
02
1 week ago
Activity icon

Replied to "Method Illuminate\Database\Eloquent\Collection::render Does Not Exist. (View: C:\xampp\htdocs\post\resources\views\layouts\categories\admin_template.blade.php

@sinnbeck , It was working before , and when I setted link for my footer,

    <li><i class="fa fa-caret-right"></i><a href="{{url('/category/old')}}">Old post</a></li>

Then it's not working, as I same controller then make route for this

return view('layouts.categories.admin_template')

    //->with('latest', $latest )
    ->with('levels', Category::take(7))
    ->with('posts', Post::all());

}

Route::get('/category/old', [

'uses'=>'[email protected]',

'as'=>'old',
'name'=>'posts'

]);

Activity icon

Replied to "Method Illuminate\Database\Eloquent\Collection::render Does Not Exist. (View: C:\xampp\htdocs\post\resources\views\layouts\categories\admin_template.blade.php

@sinnbeck , I did in that, Thanks for reply

Here is blade

         @foreach($posts->sortByDesc('id') as $post)
            <div class="col-xs-12 col-sm-6 col-md-4">
                <span class="dn">{{$loop->index+1}}</span>
                <div class="blog-entry">
                    <div class="entry--img">
                        <a href="#">
                            @if ($post->featured)
                            <img src="{{ $post->featured }}" alt="entry image"/>
                            @endif
                        </a>
                    </div>
                    <div class="entry--content">
                        <div class="entry--title">
                            <h4>{{$post->title}}</h4>
                        </div>
                        <div class="entry--bio">
                            <p class="my-news" style="text-align:justify">{{$post->content}}<a style="font-weight:bold" target="_blank" href="{{ asset("$post->file") }}">...Read More</a>
                        </div>
                        <div class="entry--footer ">
                            <div class="entry--by">
                                <div class="entry--by-content ar-pl-left">
                                    <b>Source</b> : {{$post->source}}
                                </div>
                            </div>
                        </div>
                    </div>

                </div>

            </div>
                @endforeach


        </div>
        <!-- .row end -->
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 clearfix mt-20 text--center">
                {{$posts->render()}}
            </div>
            <!-- .col-md-12 end -->
        </div>
    </div>
    <!-- .container end -->
Activity icon

Started a new Conversation "Method Illuminate\Database\Eloquent\Collection::render Does Not Exist. (View: C:\xampp\htdocs\post\resources\views\layouts\categories\admin_template.blade.php

For another template it's working when using render then it's not working

Blade.php

{{$posts->render()}}

and Controller

public function posts() {

    return view('layouts.categories.admin_template')

        //->with('latest', $latest )
        ->with('levels', Category::take(7))
        ->with('posts', Post::all());


}
Nov
08
1 month ago
Activity icon

Started a new Conversation Can I Set The Command In Controller To Show The Data Only Last And Latest 5 Min In Laravel?

I need all data created 3 minutes ago. If the time is 10:00 and data was created, then at when query is made 10:03, I should get all data created at 10:00. If query made 10:04, no data show be returned and also want to auto load the page after 5 minutes so can check the update if new data has in database row?

Thank you all :)

Nov
07
1 month ago
Nov
06
1 month ago
Activity icon

Replied to How To Use Of IoT Sensor Machine To Get Real Time Data And Save In Databse In Laravel

@sinnbeck thanks, I have a IoT device , now I am trying to save data from this real time device and save in database ....please help with this.

Activity icon

Started a new Conversation How To Use Of IoT Sensor Machine To Get Real Time Data And Save In Databse In Laravel

How to fetch IoT sensor data from machine device and save in database in Laravel,?

Oct
15
1 month ago
Activity icon

Replied to Getting Error Like "Uninitialized String Offset: 2"

sure @Sinnbeck

Here is my PastControllercontroller-

                public function store(Request $request)
{

    //dd($request->all());
    $data = new past_events();
    $data->title = $request->title;
    $data->event_date = $request->event_date;
    $data->event_video_link = $request->event_video_link;
    $data->event_place_name = $request->event_place_name;
    $data->category_id = $request->category_id;
    $data->slug =str_slug($request->title);

    if (request('Image'))
    {
        $File = request('Image');
        $file_name = time() . $File->getClientOriginalName();
        $File->move('uploads/past', $file_name);
        $data['Image'] = 'uploads/past/'.$file_name;
    }

    $data->save();

    $id = $data->id; // foreign_key

    if($request->hasFile('Featured')){
        foreach ($request->file('Featured') as $key=>$file)

        {
            $speaker=new past_event_speaker();

            $speaker-> past_event_id = $id;

            $filename=time().$file->getClientOriginalName();

            $file->move('uploads/past/',$filename);

            $speaker->Featured=$filename;

           $speaker->slug = str_slug($request->speaker_name[$key], '-');

            $speaker->speaker_name=$request->speaker_name[$key];

            $speaker->category_id=$request->category_id[$key];

            $speaker->speaker_position=$request->speaker_position[$key];

            $speaker->save();


        }
    }


    if($request->hasFile('Featured1') and ('File')) {

        foreach ($request->file('Featured1','File')  as $key=>$file){

            $session = new past_event_session();

            $session-> past_event_id = $id;

            $filename=time().$file->getClientOriginalName();

            $file->move(public_path().'uploads/past/',$filename);

            $session->Featured1=$filename;

            $session->File=$filename;

            $session->session_time=$request->session_time[$key];

            $session->event_session_name=$request->event_session_name[$key];

            $session->session_person_name=$request->session_person_name[$key];

            $session->session_person_topic=$request->session_person_topic[$key];

            $session->save();
        }
    }

    Session::flash('success', 'Post updated successfully.');

    return redirect()->route('past_event');
}

Then my FrontendController is here

                              public function singlePost1($slug)
{


   $past_event=past_events::whereSlug($slug)->get();

   $past_event_speaker=past_event_speaker::where('slug',$slug)->get();

 //   dd(past_event_speaker::all());

    return view('single', compact($past_event,$past_event_speaker))

        ->with('adv', $past_event)

        ->with('past_event',$past_event )


     ->with('past_event_speaker', $past_event_speaker)

        ->with('levels', Category::take(7)->get());
}
Activity icon

Started a new Conversation Getting Error Like "Uninitialized String Offset: 2"

Good Morning All, I am trying to add more than two column in my section, however it's throwing error like ""Uninitialized string offset: 2" and also my 2 column is adding in database successfully but not showing in my blade page(I raised this query before, but still in error). Thank you all :)

Oct
11
1 month ago
Activity icon

Replied to My Error Is "404 Not Found", When Tying To Retrieve Multiple Database In One Single Page

Thanks @munazzil

Now it's error when i am using first()

"Invalid argument supplied for foreach() (View: C:\xampp\htdocs\CERCAA\resources\views\single.blade.php)".

Oct
10
1 month ago
Activity icon

Replied to My Error Is "404 Not Found", When Tying To Retrieve Multiple Database In One Single Page

@sinnbeck , here is index function to show the data

public function index() { $Past=past_events::join('categories', 'categories.id', '=', 'past_events.category_id')

        ->select(
            'categories.id',
            'categories.name',
            'categories.slug'
        )
        ->orderBy('id','desc')
        ->get();

    return view('admin.Past.index',compact('Past'))

        ->with('past_events', past_events::all())
        ->with('past_event_speaker', past_event_speaker::all());
}

Thanks

Activity icon

Replied to My Error Is "404 Not Found", When Tying To Retrieve Multiple Database In One Single Page

Yes, here is my code for 2nd section where i want to display the data from 2nd database

     <section id="portfolio" class="portfolio portfolio-standard portfolio-3col">
    <div class="container">
        <div class="row clearfix">
            <div class="col-xs-12 col-sm-12 col-md-6 col-md-offset-3">
                <div class="heading heading-3 mb-50 text--center">
                    <h2 class="heading--title">EVENT SPEAKERS</h2>
                    <p class="heading--subtitle">Here are some of our speakers</p>
                    <div class="divider--line divider--center"></div>
                </div>
            </div>
            <!-- .col-md-6 end -->
        </div>
        <!-- .row end -->
        <div class="row">
            @foreach($past_event_speaker as $post)
            <div class="col-xs-12 col-sm-6 col-md-4 portfolio-item filter-web">
                <div class="portfolio--img">
                    <img src="{{$post->Featured}}" alt="Portfolio Item">
                    <div class="portfolio--hover">
                        <div class="portfolio--action">
                            <div class="pos-vertical-center">
                                <div class="portfolio-zoom">
                                    <a class="img-popup" href="{{$post->Featured}}" title="Portfolio Item">
                                        <i class="icon--zoom"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <!-- .Portfolio-action end -->
                    </div>
                    <!-- .Portfolio-hover end -->
                </div>
                <!-- .Portfolio-img end -->
                <div class="portfolio--content">
                    <div class="portfolio--title">
                        <h4><a href="#">{{$post->speaker_name}}</a></h4>
                    </div>
                    <div class="portfolio--cat">
                        <a href="#">{{$post->speaker_position}}</a>
                    </div>
                </div>
            </div>


                @endforeach
        </div>
        <!-- .row end -->
    </div>
    <!-- .container end -->
</section>
Activity icon

Replied to My Error Is "404 Not Found", When Tying To Retrieve Multiple Database In One Single Page

Now error has finised @sinnbeck , as I used get() however still not showing my data from 2nd database table. thanks and my controller is

     public function store(Request $request)
{

    //dd($request->all());
    $data = new past_events();
    $data->title = $request->title;
    $data->event_date = $request->event_date;
    $data->event_video_link = $request->event_video_link;
    $data->event_place_name = $request->event_place_name;
    $data->category_id = $request->category_id;
    $data->slug =str_slug($request->title);

    if (request('Image'))
    {
        $File = request('Image');
        $file_name = time() . $File->getClientOriginalName();
        $File->move('uploads/past', $file_name);
        $data['Image'] = 'uploads/past/'.$file_name;
    }

    $data->save();

    $id = $data->id; // foreign_key

    if($request->hasFile('Featured')){
        foreach ($request->file('Featured') as $key=>$file)

        {
            $speaker=new past_event_speaker();

            $speaker-> past_event_id = $id;

            $filename=time().$file->getClientOriginalName();

            $file->move('uploads/past/',$filename);

            $speaker->Featured=$filename;

            $speaker->slug = str_slug($request->speaker_name[$key], '-');

            $speaker->speaker_name=$request->speaker_name[$key];

            $speaker->category_id=$request->category_id[$key];

            $speaker->speaker_position=$request->speaker_position[$key];

            $speaker->save();


        }
    }


    if($request->hasFile('Featured1') and ('File')) {

        foreach ($request->file('Featured1','File')  as $key=>$file){

            $session = new past_event_session();

            $session-> past_event_id = $id;

            $filename=time().$file->getClientOriginalName();

            $file->move(public_path().'uploads/past/',$filename);

            $session->Featured1=$filename;

            $session->File=$filename;

            $session->session_time=$request->session_time[$key];

            $session->event_session_name=$request->event_session_name[$key];

            $session->session_person_name=$request->session_person_name[$key];

            $session->session_person_topic=$request->session_person_topic[$key];

            $session->save();
        }
    }

    Session::flash('success', 'Post updated successfully.');

    return redirect()->route('past_event');
}
Activity icon

Replied to My Error Is "404 Not Found", When Tying To Retrieve Multiple Database In One Single Page

@munazzil ,now error has finished , however still my database data is not showing on page

Activity icon

Replied to My Error Is "404 Not Found", When Tying To Retrieve Multiple Database In One Single Page

@sinnbeck , i with that login , still it's not changed , showing "404 Not Found".

Activity icon

Replied to My Error Is "404 Not Found", When Tying To Retrieve Multiple Database In One Single Page

@munazzil thanks, I checked all post are stored in database but not showing in one single page

Activity icon

Replied to My Error Is "404 Not Found", When Tying To Retrieve Multiple Database In One Single Page

Thanks @sinnbeck

Here is code

public function singlePost1($slug) {

    $past_event=past_events::whereSlug($slug)->firstOrFail();

   $past_event_speaker=past_event_speaker::where('slug',$slug)->firstOrFail();

    return view('single', compact($past_event,$past_event_speaker))

        ->with('adv', $past_event)

        ->with('past_event',$past_event )


     ->with('past_event_speaker', $past_event_speaker)

        ->with('levels', Category::take(7)->get());
}
Activity icon

Started a new Conversation My Error Is "404 Not Found", When Tying To Retrieve Multiple Database In One Single Page

I have multiple database and trying to show the all data from all database table on my single page, however it's not showing anything. 404 Not Found

Oct
03
2 months ago
Activity icon

Replied to Can View Multiple Data From Multiple Database Table In Single Blade Page?

@mstrauss , it's working with code , however not opening for another database as used slug. thanks

Oct
01
2 months ago
Activity icon

Replied to Can View Multiple Data From Multiple Database Table In Single Blade Page?

Yes @mstrauss , here is result that I have been gone with dying and dump

https://ibb.co/kMFSP9j

Activity icon

Replied to Can View Multiple Data From Multiple Database Table In Single Blade Page?

thanks @mstrauss , Here is Controller

if($request->hasFile('Featured')){ foreach ($request->file('Featured') as $key=>$file)

        {

            $speaker=new past_event_speaker();
            $speaker-> past_event_id = $id;
            $filename=time().$file->getClientOriginalName();
            $file->move(public_path().'uploads/past/',$filename);
            $speaker->Featured=$filename;
            $speaker->slug =str_slug($request->speaker_name);
            $speaker->speaker_name=$request->speaker_name[$key];
            $speaker->category_id=$request->category_id[$key];


            $speaker->speaker_position=$request->speaker_position[$key];
            $speaker->save();
        }
   

When I am using this $speaker->slug =str_slug($request->speaker_name); then getting error is-->""mb_strtolower() expects parameter 1 to be string, array given"

And When I am using this $speaker->slug==str_slug($request->slug[$key]); then error is-->"General error: 1364 Field 'slug' doesn't have a default value (SQL: insert into past_event_speakers (past_event_id, Featured, `speaker_na

Thanks ;)

Activity icon

Replied to Can View Multiple Data From Multiple Database Table In Single Blade Page?

@resin thanks, I have 2 database and both data I am trying to show on single page , it's showing error ""mb_strtolower() expects parameter 1 to be string, array given""

Activity icon

Started a new Conversation Can View Multiple Data From Multiple Database Table In Single Blade Page?

Hello Everyone,

Is it possible to view multiple data from multiple database in single blade page and also can single SLUG can be used from multiple database to view in one page in laravel?

Thank,

Sep
30
2 months ago
Activity icon

Replied to Getting Error Like Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array,

@tray2 thanks, I did as you have suggested. However, only image problem. thanks

Sep
27
2 months ago
Activity icon

Replied to Getting Error Like Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array,

@tray2 , I changed with this logic , throwing error, Is it right to add multiple image (Featured)?

Please suggest in it.

Thanks

Activity icon

Replied to Getting Error Like Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array,

Thanks @siangboon, Here is link for code..

1> controller->https://paste.ofcode.org/345CS7zgbDvT4uCdzgKtfcW

2>Create.blade.php->https://paste.ofcode.org/8eBxj7rD77GrnbEBYW7tNm

3> Model->past_event->https://paste.ofcode.org/6MtuQA7dnsu2wHWw4CivMZ

4>Model->past_event-speaker->https://paste.ofcode.org/agPLRm8t8tBTFdTtmLCzKq

5>Model->past_event-session->https://paste.ofcode.org/33T6nmH729w6tBtFL3m8SBK

Here is all code link so you can chech, only Image are showing in index, however, Featured , Featured1, File and slug is not working.

Activity icon

Replied to Getting Error Like Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array,

@snapey , @tray2 , @slev1n , Now data are submitting in simple form and also for array form for all 3 section , However, Image is showing NULL, and Featured1 has data like "C:\xampp\tmp\php4CD9.tmp" and For file "C:\xampp\tmp\php4CDA.tmp" and for Featured it's showing like "C:\xampp\tmp\php4CC7.tmp" in data base..Thanks to all

Activity icon

Replied to Getting Error Like Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array,

@snapey , no, For first table all are in simple form and for 2nd table and 3rd table they are in array.

Activity icon

Replied to Getting Error Like Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array,

@snapey , As title and all column store in single table so I am not using name="title[]" i have like name="title"..but still getting same error.

Activity icon

Replied to Getting Error Like Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array,

@slev1n , in title, slug,event_date,event_video_link,event_place_name and category_id are in first table where I not using array just passing single time value. and in another I am using array, so that it's showing. Thanks

Activity icon

Replied to Getting Error Like Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array,

First Thanks for your reply @tray2 ...

Here is my controller...

                 public function store(Request $request)
{
  //  dd($request->all());
    $data = new past_events();
    $data->title = $request->title;
    $data->slug = $request->slug;
    $data->event_date = $request->event_date;
    $data->event_video_link = $request->event_video_link;
    $data->event_place_name = $request->event_place_name;
    $data->category_id = $request->category_id;

    if($request->hasFile('image'))
    {
        $image = request('image');
        $filename = time().$image->getClientOriginalName();
        $image->move(public_path().'uploads/past/',$filename);
        $data->image = $filename;
   }
    $data->save();

    $id = $data->id; // foreign_key

    foreach ($request->Featured as $key=>$file){
        $speaker=new past_event_speaker();
        $speaker->past_event_id = $id;
        $speaker->Featured = $request->Featured[$key];(this is for image)
        $speaker->speaker_name = $request->speaker_name[$key];
        $speaker->speaker_position = $request->speaker_position[$key];

        $speaker->save();
    }

    foreach ($request->Featured1 as $key=>$file){
        $session = new past_event_session();
        $session->past_event_id = $id;
        $session->Featured1 = $request->Featured1[$key];   (This is for image)
        $session->session_time = $request->session_time[$key];
        $session->event_session_name = $request->event_session_name[$key];
        $session->session_person_name = $request->session_person_name[$key];
        $session->session_person_topic = $request->session_person_topic[$key];
        $session->File =$request->File[$key];(This is for pdf file)

        $session->save();
    }
}
Activity icon

Started a new Conversation Getting Error Like Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array,

Hey All,

I am about to done almost my 1st training demo project for job but somehow last error is coming, previously I posted the same question for this but it was not answered. Please help so can sort out error.

Argument 1 passed to Illuminate\Database\Grammar::parameterize() must be of the type array, null given, called in :\xampp\htdocs\testCER\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php on line 87

Sep
25
2 months ago
Activity icon

Replied to Getting Error Like ""Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array, Null Given, Called In C:\xampp\htdocs\CAA\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php On Line 871"

@mstrauss , thanks, Featured ,Featured1 for images respectively. (trying to add multiple data ex:text, image and pdf) and also I changed into Featured ,Featured1 but still same error.

$speaker->Featured = $request->Featured[$key]; $session->Featured1 = $request->Featured1[$key];

Sep
24
2 months ago
Activity icon

Started a new Conversation Getting Error Like ""Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array, Null Given, Called In C:\xampp\htdocs\CAA\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php On Line 871"

I just sort out foreign key issue and after that when running my code , getting error like. Is my controller not properly coded or what? Thank you...

My controller

        public function store(Request $request)
{
  //  dd($request->all());
    $data = new past_events();
    $data->title = $request->title;
    $data->slug = $request->slug;
    $data->event_date = $request->event_date;
    $data->event_video_link = $request->event_video_link;
    $data->event_place_name = $request->event_place_name;
    $data->category_id = $request->category_id;

    if($request->hasFile('image'))
    {
        $image = request('image');
        $filename = time().$image->getClientOriginalName();
        $image->move(public_path().'uploads/past/',$filename);
        $data->image = $filename;
   }
    $data->save();

    $id = $data->id; // foreign_key

    foreach ($request->Featured as $key=>$file){
        $speaker=new past_event_speaker();
        $speaker->past_event_id = $id;
        $speaker->Featured = $request->Featured;
        $speaker->speaker_name = $request->speaker_name[$key];
        $speaker->speaker_position = $request->speaker_position[$key];
        $speaker->save();
    }

    foreach ($request->Featured1 as $key=>$file){
        $session = new past_event_session();
        $session->past_event_id = $id;
        $session->Featured1 = $request->Featured1;
        $session->session_time = $request->session_time[$key];
        $session->event_session_name = $request->event_session_name[$key];
        $session->session_person_name = $request->session_person_name[$key];
        $session->session_person_topic = $request->session_person_topic[$key];
        $session->save();
    }
}
Activity icon

Replied to 1005 Can't Create Table `cercaa`.`#sql-1a7c_14ce` (errno: 150 "Foreign Key Constraint Is Incorrectly Formed")")

@sergiu17 , thank you so much, I just find the error (I was taking wrong table name for reference). All done:)

Activity icon

Replied to 1005 Can't Create Table `cercaa`.`#sql-1a7c_14ce` (errno: 150 "Foreign Key Constraint Is Incorrectly Formed")")

@sergiu17 @devronbaldwin , I changed it to bigInteger instead of bigIncrements but still has same issue.. thanks for your response

Activity icon

Replied to 1005 Can't Create Table `cercaa`.`#sql-1a7c_14ce` (errno: 150 "Foreign Key Constraint Is Incorrectly Formed")")

@sergiu17 thanks, However, next error is like-- Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined a s a key

Activity icon

Started a new Conversation 1005 Can't Create Table `cercaa`.`#sql-1a7c_14ce` (errno: 150 "Foreign Key Constraint Is Incorrectly Formed")")

I have 3 table and when trying to use Foreign key for relationship between them but getting error...Thanks

First table:

         public function up()
{
    Schema::create('events1', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('date')->nullable();
        $table->string('link')->nullable();
        $table->string('name')->nullable();
        $table->unsignedInteger('category_id')->nullable();
        $table->softDeletes();
        $table->timestamps();
    });
}

2nd table

      public function up()
{
    Schema::create('events2', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->integer('past_events_id')->unsigned();
        $table->foreign('past_events_id')->references('id')->on('past_events')->onDelete('cascade');
        $table->string('same')->nullable();
       $table->string('Featured')->nullable();
        $table->softDeletes();
        $table->timestamps();
    });
}

3rd table

    public function up()
{
    Schema::create('events3', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->integer('past_events_id')->unsigned();
        $table->foreign('past_events_id')->references('id')->on('past_events')->onDelete('cascade');
        $table->string('name')->nullable();
        $table->string('time')->nullable();
              $table->string('Featured1')->nullable();
        $table->string('File')->nullable();
        $table->softDeletes();
        $table->timestamps();
    });
}
Sep
06
3 months ago
Activity icon

Replied to How To Add Multiple Image With 2 Filed Using Laravel?

@jlrdw , I am trying to upload with image and gone through the tutorial, and as doing same, but here in my form I am using clone-form so when trying to submit the data then my data is like

"speaker_name" => array:2 [ 0 => "sdsdsd" 1 => null ].. thanks..

Activity icon

Replied to How To Add Multiple Image With 2 Filed Using Laravel?

Thanks.. @snapey . When I am using dd($request->all()); in my first array data is showing, however in 2nd array it's NULL value...

"speaker_name" => array:2 [ 0 => "sdsdsd" 1 => null ]