amk

amk

Member Since 1 Year Ago

Experience Points 10,280
Experience Level 3

4,720 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 45
Lessons
Completed
Best Reply Awards 3
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

15 Jan
5 months ago

amk left a reply on Can't Change Data After Using Axios

mounted(){
  this.id = document.querySelector("input[name=tie]").value;
    axios.get(`/chapter/quiz/${this.id}`)
    .then(function (response) {
      this.question = response.data.title;
      console.log(response.data);
    }.bind(this))
    .catch(function (error) {
      console.log(error);
    });
}

here @cronix

.bind(this)

in mounted.

amk left a reply on Can't Change Data After Using Axios

got it! :3

mounted(){
    axios.get(`/chapter/quiz/`)
    .then(function (response) {
      this.question = response.data.title;
      console.log(response.data);
    }.bind(this))
    .catch(function (error) {
      console.log(error);
    });
}

amk started a new conversation Can't Display Data After Mounted

<div id="app">
<p>@{{question}}</p>
<input type="text" v-model="question">
<div>
<script>
let app = new Vue({
  el:"#app",
 data: {
   question: null,

 },
mounted(){
    axios.get(`/chapter/quiz/`)
    .then(function (response) {
      this.question = response.data.title;
      console.log(response.data);
    })
    .catch(function (error) {
      console.log(error);
    });
}
})
</script>

In Console show data like that

Object { id: 1, title: "ttttttttttttt", chapter_id: 39, m_id: 1, c_type_id: 1, c_body_id: 2, a: "te", b: "ere", c: "tete", d: "te", … }

Why can not change question data?

06 Jan
5 months ago

amk left a reply on Live Video Streaming

it is just only live streaming. After live streaming is finsihed,I want this video record. How to do it. Please suggest me. @topvillas @

12 Dec
6 months ago

amk started a new conversation It Doesn't Change Real Time In Vue-cli?

After I changed from App.vue,it doesn't change in browser. I need to rerun npm run dev for change updated data. Is it npm error?

11 Dec
6 months ago

amk left a reply on Trying To Get Property 'id' Of Non-object

    public function index()
    {
        
        $universities = University::all();
    dd($universities);
        return view('university.index', ['universities' => $universities]);
    }

check this!

08 Dec
6 months ago

amk left a reply on Uploaded Multiple File Function GetClientOriginalName() On Null

So,What is your problem? you should show us all code!

amk left a reply on Property [post] Does Not Exist On This Collection Instance

:3

Route::get('/user/{id}/post',function($id){ 
$user = users::with('post')->where('id',$id)->get(); return $user->post; });

amk left a reply on Uploaded Multiple File Function GetClientOriginalName() On Null

If my answer is correct,pls can you choose best answer?

amk left a reply on Property [post] Does Not Exist On This Collection Instance

return $this->hasOne('App\posts', 'foreign_key', 'local_key');

replace foreign_key and local_key

amk left a reply on Uploaded Multiple File Function GetClientOriginalName() On Null

I think your problem is js!

onchange="showname()"

You changed your input type 'file' to 'text' with js! Remove your js on input type file.

amk left a reply on Uploaded Multiple File Function GetClientOriginalName() On Null

pls try with only one photo not multiple! Just test it!

<input type="file  name="filename">

amk left a reply on Uploaded Multiple File Function GetClientOriginalName() On Null

Try with this!

if($request->hasFile('filename')){
 dd($request->filename);
 }
07 Dec
6 months ago

amk left a reply on How To Convert Controller Things To Blade View In Laravel

<?php $cat = ""; ?>
@foreach($vehicles->unique('brandname') as $vehicle)
   @if($vehicle->categoryname != $cat )
            <?php $cat = $vehicle->categoryname; ?>
             {{$cat}}
            <br><br>
     @endif
    {{$vehicle->brandname}} <br>
@endforeach

amk left a reply on How To Convert Controller Things To Blade View In Laravel

what do you wanna unique? categoryname or brandname?

amk left a reply on Laravel Ckeditor Display Raw Data In The Database And Post Form

you should use it in index if you want to display content data! bez ckeditor also store html code.

{!! $content !!}

amk left a reply on How To Convert Controller Things To Blade View In Laravel

Try with this!

<?php $cat = ""; ?>
@foreach($vehicles as $vehicle)
   @if($vehicle->categoryname != $cat )
            <?php $cat = $vehicle->categoryname ?>
             {{$cat}}
            <br><br>
     @endif
    {{$vehicle->brandname}} <br>
@endforeach 

amk left a reply on How To Convert Controller Things To Blade View In Laravel

@foreach($vehicles as $vehicle)
   @if($vehicle->categoryname != "")
            {{ $vehicle->categoryname }} <br><br>
     @endif
    {{$vehicle->brandname}} <br>
@endforeach

amk left a reply on Laravel Ckeditor Display Row Data In The Database And Post Form

So,what is your problem? you wanna display content data in index?

02 Dec
6 months ago

amk left a reply on Cache And Pagination

@robstar thank you Sir... If I create new user,how to delete old cache?

amk left a reply on Cache And Pagination

@jlrdw So,you mean I shouldn't use Cache if data is usually changed?

amk started a new conversation Cache And Pagination

$page = $request->has('page') ? $request->query('page') : 1;

 $user = Cache::rememberForever('user_'.$page, function () use ($course_id) {
      return User::where('course_id',$course_id)->pagination('5');
  });

I wanna know if a user create or edit,how do I forget cache?

29 Nov
6 months ago

amk started a new conversation Call To Undefined Method Maatwebsite\Excel\Excel::create()

Hi,guys... I have been add providers and aliases. I can't find yet! Still, I got the error message

 Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to undefined method Maatwebsite\Excel\Excel::create()

and my package version

        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "maatwebsite/excel": "^3.1",
        "predis/predis": "^1.1",
        "uxweb/sweet-alert": "^2.0"

controller

use Excel;

    public function export_list()
    {
      Excel::create('Export data', function($excel) {

      $excel->sheet('Sheet', function($sheet) {
      $data = User::where('city','ygn')->get();

       $sheet->fromArray($data);
      });
    })->download('xls');
    }

Pls,can you suggest me?

24 Nov
7 months ago

amk started a new conversation Why Show Old Reply In My Profile?

After I edited my reply,don't show update reply in my profile. Is that true? Why?

amk left a reply on After Form Validation All Filled Data Have Been Reset

<div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබගේ රැකියා තත්ත්වය සඳහන් කරන්න?</label>
                        <div class="col-sm-12">
                            <select id="show" class="form-control col-sm-12" name="job[]" required>
                                <option value="" >රැකියාව</option>
                                <option value="රැකියා විරහිත" {{ (collect(old('job'))->contains('රැකියා විරහිත')) ? 'selected':'' }}>රැකියා විරහිත</option>
                                <option value="පූර්ණ කාලීන සේවය" {{ (collect(old('job'))->contains('පූර්ණ කාලීන සේවය')) ? 'selected':'' }}>පූර්ණ කාලීන සේවය</option>
                                <option value="අර්ධ කාලීන සේවය" {{ (collect(old('job'))->contains('අර්ධ කාලීන සේවය')) ? 'selected':'' }}>අර්ධ කාලීන සේවය</option>
                                <option value="ගෘහණියකි" {{ (collect(old('job'))->contains('ගෘහණියකි')) ? 'selected':'' }}>ගෘහණියකි</option>
                            </select>
                        </div>
                    </div>

change like that

amk left a reply on After Form Validation All Filled Data Have Been Reset

Can you show the code? How did you test? @

amk left a reply on After Form Validation All Filled Data Have Been Reset

and this for input type="text"

    <input type="text" name="title"  value="{{old('title')}}">

amk left a reply on After Form Validation All Filled Data Have Been Reset

It is example...

<select name="options[]" class="form-control" multiple>
        <option value="test" {{ (collect(old('options'))->contains('test')) ? 'selected':'' }}>test</option>
        <option value="test1" {{ (collect(old('options'))->contains('test1')) ? 'selected':'' }}>test1</option>
</select>

amk left a reply on After Form Validation All Filled Data Have Been Reset

you mean after validation fail,show old value?

23 Nov
7 months ago

amk left a reply on Api Routes Not Working

I think your Xampp error.Pls check back xampp connection!

22 Nov
7 months ago

amk left a reply on Add Items To A Shopping Cart Without Page Reloading

I use Session and Ajax for shopping cart!

amk left a reply on How To Automatically Download A File Of Storage???

Try this bro.... I have been test it. It generate myfile.txt in public folder. pls check public folder.

public function fordownload(Request $request){
 $fileName= "myfile.txt";
 \File::put(public_path($fileName),$request->info);
 return response()->download($filename);
}

@

amk left a reply on Array To String Conversion (SQL: Insert Into `questions

I use serialize for insert array in column!

$data["ElectricMedia"] = serialize($request->ElectricMedia);

amk left a reply on How To Automatically Download A File Of Storage???

In Controller

use Storage;

public function fordownload(Request $request){

Storage::put('your_file_name', $request->info);

return Storage::download('your_file_name'); 

}

In Route

Route::post('download','[email protected]')->name('down');

In Blade

            <form action="{{route('down')}}" method="post">
                {{ csrf_field() }}
                <div class="form-group">
                    <label for="info">Add Info</label>
                    <input type="text" name="info">
                </div>
                <button type="submit" class="btn btn-primary">Submit</button>
            </form>

you want like that?

amk left a reply on Array To String Conversion (SQL: Insert Into `questions

this is error bez of multiple select..... :3

<select class="form-control col-sm-12 js-example-basic-multiple" name="ElectricMedia[]" multiple="multiple">

change like that if you don't need multiple select

<select class="form-control col-sm-12 js-example-basic-multiple" name="ElectricMedia">

amk left a reply on Resource Route Parameters Error

@TYKUS - Thank sir...

21 Nov
7 months ago

amk left a reply on Resource Route Parameters Error

@TYKUS - It is query string parameter.... sir @

amk started a new conversation Resource Route Parameters Error

Too few arguments to function App\Http\Controllers\CourseController::index(), 0 passed and exactly 1 expected

In web.php

    Route::resource('course','CourseController',['parameters' => [
    'course' => 'city',
    ]]);

Controller

    public function index($city)
    {
        dd($city);
    }

and this is from blade

<a class="" href="{{route('course.index',$city)}}">Course</a>

this is url

http://127.0.0.1:8000/backend/course?ygn

What's wrong ?

16 Nov
7 months ago

amk left a reply on Sorry, The Page You Are Looking For Could Not Be Found.

Change like this...

<button type="submit" class="btn btn-primary">Submit</button>

Have you tried with dd() from controller?

public function submitEditSchedule(Request $request) {

dd($request->all);
05 Nov
7 months ago

amk left a reply on I Am Calling Query In Every Single Function For Navbar

Can you show me example sir @tykus .

amk started a new conversation I Am Calling Query In Every Single Function For Navbar

I am calling query in every single function for navbar

  public function home()
  {
        $navbar = Course::all();
        $class = Class_::where('is_delete',0)->get();
        return view('frontend.home',compact('class','navbar'));
  }


    public function cart_list()
    {
     $navbar = Course::all();
        return view('frontend.cart_list',compact('navbar'));
    }

    public function class_list($course_)
    {
        $navbar = Course::all();
        $class = Class_::all();
        return view('frontend.class_list',compact('class','navbar'));
    }


    public function classdetail($id)
    {
        $navbar = Course::all();
        $class = Class_::findOrFail($id);
        return view('frontend.class_detail',compact('class','navbar'));
    }

my file structure like this.. header.blade.php navbar.blade.php master.blade.php footer.blade.php

I don't want to call navbar in every function.. Pls suggest me..

11 Sep
9 months ago

amk started a new conversation Uncaught (in Promise) DOMException: The Play() Request Was Interrupted By A Call To Pause()?

I can't find yet this error!

<button id'="next">next</button>

                                              <audio id="aud" controls controlsList="nodownload">
                                               <source id="audos" src="http://www.hubharp.com/web_sound/BachGavotteShort.mp3"></source>
                                                        Your browser does not support the audio element.
                                              </audio>
                                                                       
                                                <div>
     <i class="fa fa-play-circle-o" id="play" style="font-size:48px;"></i>
     <i class="fa fa-pause-circle-o" id="pause" style="font-size:48px;"></i>
                                                                    
                                                </div>




<script>

                                $('#play').on('click',function() {
                                        var playPromise = document.getElementById('aud').play();
                                        $('#play').css("display", "none");
                                        $('#pause').css("display", "block");
                                  
                                });

                                $('#pause').on('click',function() {
                                        document.getElementById('aud').pause();
                                        $('#pause').css("display", "none");
                                        $('#play').css("display", "block");
                                    
                                });

                $('#next').on('click',function() {
                $.ajax({
                    type:'get',
                    url:"{!!URL::to('/next')!!}",
                    data:{.........},
                    success:function(response){
                    $('#audos').attr('src',"{{asset('audio/')}}"+response.audio);
                    }
</script>
11 Aug
10 months ago

amk started a new conversation Setting UP SSL Certificate Files Permissions

This Question is not suitable for this site.But I need help... I tired to generate ssl csr code

cd /etc/ssl

openssl genrsa -out example.com.key 4096

openssl req -new -key example.com.key -out example.com.csr

and I changed like that...

sudo nano /etc/nginx/sites-available/example.com

I added these code..

 listen 443 ssl;
 ssl_certificate /etc/ssl/example.com.csr;
 ssl_certificate_key /etc/ssl/example.com.key;

and

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

sudo nginx -t

it show errors message like that

nginx: [emerg] PEM_read_bio_X509_AUX("/etc/ssl/example.com.csr") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE)
nginx: configuration file /etc/nginx/nginx.conf test failed

and then, I copied csr code and pasted to name.com... show like that

Your domain (www.example.com) doesn't match the domain in the CSR (false.false). 

:(

03 Aug
10 months ago

amk left a reply on A User Can Listen Only Twice Mp3 File On My Web...How To Do That?

var count = 1;
audio.onended = function(){
if(count < 2){
count++;
this.play();
}else if(count == 2){
alert('finished');
    }
}

I'm done with js!

29 Jul
10 months ago

amk started a new conversation A User Can Listen Only Twice Mp3 File On My Web...How To Do That?

Anyone can suggest me?

25 Jul
10 months ago

amk left a reply on How To Get Selected Radio Button Value In Vuejs Components?

@foreach($question->equestion as $row)
                <div>
                    <p class="card-text">{{ $row['question'] }}</p>
                    <input v-model="message" type="hidden" value="{{$row->id}}">
                    <label class="radio-inline">
                        <input type="radio" name="picked" v-model="picked" value="{{$row->a}}">{{$row->a}}
                    </label><br>

                    <label class="radio-inline">
                        <input type="radio" name="picked" v-model="picked" value="{{$row->b}}">{{$row->b}}
                    </label><br>

                    <label class="radio-inline">
                        <input type="radio" name="picked" v-model="picked" value="{{$row->c}}">{{$row->c}}
                    </label><br>

                    <label class="radio-inline">
                        <input type="radio" name="picked" v-model="picked" value="{{$row->d}}">{{$row->d}}
                    </label>

                </div>
                @endforeach
                <button v-on:click="next" class="btn btn-primary pull-right">
                    Submit
                </button>

amk left a reply on How To Get Selected Radio Button Value In Vuejs Components?

I generate only one sir @Tray2 Here...

[{"id":1,"question":"testing","a":"te","b":"tee","c":"teee","d":"t","answer":"te","audio":"","esection_id":1,"created_at":null,"updated_at":null}]

amk left a reply on How To Get Selected Radio Button Value In Vuejs Components?

@foreach($question as $row)
<input v-model="message" type="hidden" value="{{$row->id}}">
@endforeach 

I can't get value form this? why? Sir @Tray2