Msoft

Msoft

Member Since 1 Year Ago

Experience Points 3,770
Experience Level 1

1,230 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 0
Lessons
Completed
Best Reply Awards 0
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.

25 Mar
1 month ago

Msoft started a new conversation How To Find Laravel Engineer Practical Test Documents?

How can I find out Laravel/PHP Engineer Practical Test Documentations? Please give me a good source.

Thanks.

20 Feb
2 months ago

Msoft left a reply on Object Oriented Programming In PHP

@jlrdw this video series not regarding with opp. it is about basic of the php. I need opp. it is not free in laracast

Msoft started a new conversation Object Oriented Programming In PHP

Please give me good resources (I mean link or something) about the object oriented programming in PHP (Please don't give me answer as search google tell me you already experience resource directly)

Thanks.

05 Feb
2 months ago

Msoft started a new conversation What Is Differentd With Jquery And Ajax?

I am new to java scripts technologies. among them I cant understand what is different between jquery and Ajax. can you any body explain the difference or similarities between Jquery and Ajax?

Thanks.

31 Jan
2 months ago

Msoft started a new conversation Laravel Interview Questions?

I have an Interview as Software Developer in PHP and My PHP Framework is Laravel. so, Please link me some good resources you already know about Laravel Framework Interview Questions.

Thanks.

29 Jan
2 months ago

Msoft left a reply on How To Add Laravel Project On Github?

@ahsan it is paid tutorials.

28 Jan
2 months ago

Msoft left a reply on How To Develop Reservation System In Laravel?

Normaly there are lot of tutorials email verification after new use registration but I need like above system.

Msoft started a new conversation How To Develop Taxi Reservation System In Laravel?

HI, I am going to develop taxi reservation system using Laravel. my key functions are as following.

  1. user make reservation using form and submit the data.

2.after submit form data user should verify reservation using email link.

3.after click verify link those information should sent to admin email account.

above 3 functions are main features in my reservation application. actually I have no any experience earlier like this. and no any experience working with email. please if you can send me some tutorials link such as similar system or some steps to develop above system.

Thanks!

27 Jan
2 months ago

Msoft left a reply on How To Add Laravel Project On Github?

@ahsan OK give me little time after watch I will mark as best answer

Thanks

26 Jan
3 months ago

Msoft started a new conversation How To Add Laravel Project On Github?

I am new to github. I have Laravel project in my desktop and I need create new repository on github and upload Laravel file to github account. I have installed git to the computer. please give me simple and clear tutorials link how can I do this?

Thanks!

22 Jan
3 months ago

Msoft started a new conversation What Is Different Between Passport And JWT?

I am little bit new for api development. we met often passport and jwt with API. what is deference between passport and jwt?

19 Jan
3 months ago

Msoft started a new conversation What Is Object Oriented Programming In PHP

I am very new for oop in PHP. I need to learn oop in PHP. please let me know good learning resource.

Thanks.

18 Jan
3 months ago

Msoft left a reply on What Is The Main Purpose Of Developing REST API?

@douglasakula @audunru can you give me some good and simple rest api development tutorials links with Laravel?

Msoft started a new conversation What Is The Main Purpose Of Developing REST API?

what is the main purpose of developing REST API. please explain with some example?

17 Jan
3 months ago

Msoft left a reply on Can I Customize Laravel Auth Login?

@hdsavani how can I use like "nic" for login except email with artisan auth command?

16 Jan
3 months ago

Msoft started a new conversation Can I Customize Laravel Auth Login?

HI, I have some problem with laravel Auth command Login and Restration. I have default laravel login system using auth command. but I need login with nic number instead email. can I change username as nic with new nic column in user table?

20 Dec
4 months ago

Msoft started a new conversation How To Verify Online Reservation User And Inform Admin Via Email?

HI, currently I am developing online simple taxi booking system using Laravel. actually it is basic reservation system. it is functionality like following,

  1. users booking taxi over website

  2. then user receiving conformation email to users email

  3. then user logged with the system and confirmed by clicking on the link to verify user email

  4. after confirm admin receiving email including users booking details.

actually I do not use any database for these process. I like to handle those posses via emails? I allready have developed email verification system to register users. but in this app there are no need users registration. any way I have following questions here

  1. is this ok to develop without database

2.if you already know some tutorials same to this matter please send me those resources links also.

Thanks.

25 Nov
5 months ago

Msoft left a reply on Why Did Not Delete Table Records In Laravel 5?

@snapey if I use this type

<form action="{{route('clients.destroy',$client) }}" method="POST">
        @method('DELETE')
        @csrf
        <button class='btn btn-danger float-right btn-sm' type="submit" data-toggle="confirmation" >Delete Client</button>
    </form>

how can I manage route and Controller?

Msoft left a reply on Why Did Not Delete Table Records In Laravel 5?

@snapey please explain me what is the meaning of in your answer

clients.destroy

I think clients is view file name and destroy is function name am I correct?

Msoft left a reply on Why Did Not Delete Table Records In Laravel 5?

@snapey then, what should I do this fix? actually I am confuse with this? is this Personal scope problem?

Msoft left a reply on Why Did Not Delete Table Records In Laravel 5?

@robfrancken amazing I cant see [email protected] on php artisan route:list

Msoft left a reply on Why Did Not Delete Table Records In Laravel 5?

@robfrancken plase see my route

Route::get('myads/{id}/delete', [
    'uses' => '\App\Http\Controllers\[email protected]',
    
]);

Msoft started a new conversation Why Did Not Delete Table Records In Laravel 5?

working with Laravel and has table called as vehicles and I need delete table records who are logged with the app and related to create records with logged user, I am showing logged user records with following

vehicle model

public function scopePersonal($query)
{
     return $query->where('user_id', Auth::user()->id);

}

and VehcicleController

public function indexpersonel()
    {
         $vehicles = Vehicle::personal()->get();
        return view('vehicles.myads')->withVehicles($vehicles);
    }

and my ads delete buttons link

<td><a class="button is-outlined" href="/myads/{{$vehicule->id}}/delete" onclick="return confirm('Are you sure to want to delete this record?')" >Delete</a></td>

and vehicle controller delete function

public function deleteOneAd($id)
    {
        DB::table('vehicles')
            ->where('id', $id)

            ->delete();
        return redirect()->back();
}

but when I clicked delete button and accept javascripts popup it is not deleting vehicles table records. how can I fix this problem?

10 Nov
5 months ago

Msoft left a reply on Why Did Not Display Latest Updated Record From The Table In Laravel 5.6

@snapey did you mean this kind of scope,

public function scopeadvertise($query)
{
     return $query->Vehicle::with('uploads')
            ->paidAdverts()
            ->latest('updated_at');
      
}

Msoft left a reply on Why Did Not Display Latest Updated Record From The Table In Laravel 5.6

@snapey I did your comments on controller but still same results here. but I did not understand what you suggest on model in your answer. it is not clear for me...

Msoft started a new conversation Why Did Not Display Latest Updated Record From The Table In Laravel 5.6

Working with Laravel 5.6 and mysql in my app. I have two tables as vehicles and uploads, both Models relationship are as following, Vehicle Model,

public function uploads()
{
    return $this->hasMany(Upload::class);
} 

Upload Model,

public function vehicle()
{
    return $this->belongsTo(Vehicle::class);
}

and My vehicles table structure is as following,

id  name  adtype  created_at  updated_at
1   asc          1         2018-10-11  2018-10-11
2   lop          0         2018-11-09  2018-11-09
3   hyu         1         2018-11-10  2018-11-10

now I need to grab from vehicle table adtype == 1 and latest updated_at records, so I have following controller,

public function showad()
{
    $vehicles = Vehicle::with('uploads')
            ->orderBy('adtype')
            ->latest('updated_at');

    return view('vehicles.slider')->withVehicles($vehicles);
}

and My route is,

Route::get('vehicles.slider', [
    'uses' => '[email protected]',
    'as'   => 'vehicles.slider',
]);

and slider.blade.php is

@foreach( $vehicles->uploads as $upload)
    <img src="/images/{{ $upload->resized_name }}" height="150" width="200" >
@endforeach

and now I have include this slider blade file with show.blade.php file as following,

<div class="col-md-4">
@include('vehicles.slider')
</div>

show blade file url is like this,

http://localhost:8000/all-ads/23  // 23 is vehicle id

now my problem is here in my include slider blade file in show blade file. it is not showing latest updated vehicle table records. it is all ways showing existing show blade file include vehicle id records. as an example when I visit vehicle id 23 in show blade file my include file result is equel vehicle id 23. but I need latest updated vehicle id records in slider blade file. how can I do this? uploads table structure

id imagename vehicle_id
1  bgffg.png          1
2  jhjfhj.jpeg         2
3  jsdhj.png          1 
04 Nov
5 months ago

Msoft left a reply on Method Links Does Not Exist In Laravel 5.6 App?

@Cronix working without latest method but without latest it is not satisfy my business logic here....

03 Nov
5 months ago

Msoft left a reply on Method Links Does Not Exist In Laravel 5.6 App?

if it is work latest method my problem may solve

Msoft left a reply on Method Links Does Not Exist In Laravel 5.6 App?

@Cronix in your answer this one is working,

Vehicle::search($request->get('search'))->paginate(10);

but search results did not display according to the updated_at values.

but when used

Vehicle::search($request->get('search'))->latest('updated_at')->paginate(10);

it is got

Method latest does not exist.

Msoft left a reply on Method Links Does Not Exist In Laravel 5.6 App?

@Snapey now got

Method latest does not exist

error message

Msoft left a reply on Method Links Does Not Exist In Laravel 5.6 App?

@Snapey yes I have tried with following code,

if($request->has('search')){
            $vehicles = Vehicle::search($request->get('search'))
                        ->orderBy('adtype','DESC')

            ->latest('updated_at')
            ->paginate(10);
    });  //line 34
        }else{
            $vehicles = Vehicle::paginate(10);
        }
        return view('vehicles.index', compact('vehicles'));
    }

it occured

1/1) FatalErrorException

syntax error, unexpected ')'
in SearchController.php line 34

Msoft left a reply on Method Links Does Not Exist In Laravel 5.6 App?

@Cronix

use Searchable;
     protected $guarded = [];

    public function searchableAs()
    {
        return 'categoryname';
    }

Msoft left a reply on Method Links Does Not Exist In Laravel 5.6 App?

@Cronix [email protected] function is,

public function search(Request $request)
    {
        if($request->has('search')){
            $vehicles = Vehicle::search($request->get('search'))->get()->sort(function ($a, $b) {
        if ($a->adtype !== $b->adtype) {
            return $b->adtype - $a->adtype;
        }
    
        return $a->adtype
            ? ($a->updated_at->gt($b->updated_at) ? -1 : 1)
            : ($a->created_at->gt($b->created_at) ? -1 : 1);
    });  
        }else{
            $vehicles = Vehicle::get();
        }
        return view('vehicles.index', compact('vehicles'));
    }
    

Msoft left a reply on Method Links Does Not Exist In Laravel 5.6 App?

@Cronix then how can do SearchController code as VehicleController index function??? I tried with many ways but got errors

Msoft left a reply on Method Links Does Not Exist In Laravel 5.6 App?

@Snapey this is related to my old post https://laracasts.com/discuss/channels/laravel/how-can-i-put-paginate-method-in-my-controller-index-function in this case in [email protected] function I need what I need in the VehicleController index function. that mean after search attempt business rules should be satisfy.

Msoft left a reply on Method Links Does Not Exist In Laravel 5.6 App?

@Snapey that is occurred above error massage. but without blade file {{ $vehicles->links() }} it is working....

Msoft started a new conversation Method Links Does Not Exist In Laravel 5.6 App?

working with laravel 5.6 and in My comtroller I have two tables like vehicles and uploads.relationship with both two tables are, Vehicle Model,

public function uploads()
    {
        return $this->hasMany(Upload::class);
    }

and Upload Model,

 public function vehicle()
    {
        return $this->belongsTo(Vehicle::class);
    }

and I have following index function in My VehicleController,

$vehicles = Vehicle::with('uploads')
            ->orderBy('adtype','DESC')

            ->latest('updated_at')
            ->paginate(5);

            return view('vehicles.index')->withVehicles($vehicles);

and index blade file is,

<form method="GET" action="{{ url('search') }}">
      {{csrf_field()}}
            <div class="row">
                <div class="col-md-6">
                    <input type="text" name="search" class="form-control" placeholder="Search">
                </div>
                <div class="col-md-6">
                    <button class="btn btn-info">Search</button>
                </div>
            </div>
        </form>

        <br> 

@forelse( $vehicles as $vehicule )


                    @if( $vehicule->uploads->count() > 0 )
                        <a href="{{ route('vehicles.show', $vehicule->id) }}">
                            @php
                                $upload = $vehicule->uploads->sortByDesc('id')->first();
                            @endphp

                            <div style="border-style: solid; background-color: {{ $vehicule->adtype === 1 ? '#FFEFD5' : '#FFFFFF' }} ">
                            <img src="/images/{{ $upload->resized_name }}" height="150" width="250"></a>


                        {{ Carbon\Carbon::parse($vehicule->created_at)->diffForHumans()}} 
                            {{$vehicule->provincename}}
                          {{$vehicule->milage}}

                          </div>
<br>
                           <hr>

                    @endif

            @empty
                <td>No Advertisment to display.</td>
            @endforelse

</div>

</div>
</div>
{{ $vehicles->links() }}
</div>
@endsection

my pagination is working fine, but in my index file I have search input using algolia. when I use keyword and click search button following error is occured,

(2/2) ErrorException

Method links does not exist. (View: C:\Users\banda\Desktop\ddddd\resources\views\vehicles\index.blade.php)

how can fix this problem?

28 Oct
5 months ago

Msoft left a reply on How Can I Put "paginate" Method In My Controller Index Function?

@Snapey it is working but violate My business logic. that means current my application adtype=1 values show latest updated ads in the view file. but in your index function show only adtype=1 values in the top of the pades and not print latest updated_at records on the top

Msoft left a reply on How Can I Put "paginate" Method In My Controller Index Function?

@Snapey My Controller,

public function index()
    {
        $vehicles = Vehicle::with('uploads')
            ->orderBy('adtype','DESC')
            ->latest()
            ->paginate(10);

            return view('vehicles.index')->withVehicles($vehicles);
}

Msoft left a reply on How Can I Put "paginate" Method In My Controller Index Function?

@Snapey got this error,

ErrorException

Call to undefined method Illuminate\Database\Query\Builder::links() (View: C:\Users\Nalaka\Desktop\acxian\resources\views\vehicles\index.blade.php)

Msoft left a reply on How Can I Put "paginate" Method In My Controller Index Function?

@Snapey simply this is the logic I need. adtype maintain payment ad or free ad 1= payment ad and 0= free ad. and "adtype=1" records should show according to updated_at values. and free ads "adtype=0" should show according to created_at values of the table.

Msoft left a reply on How Can I Put "paginate" Method In My Controller Index Function?

@Snapey I need show some shoring results according to My Business logic. that means I need show data according to adtype of vehicle columns if adtype 1 then those ads should show before the adtype values 0 . and adtype 1 should show according to table updated_ad and adtype values 0 should show according to created_at values of the table values.

Msoft left a reply on How Can I Put "paginate" Method In My Controller Index Function?

@Snapey please see My blade file,

@extends('layouts.app')

@section('content')
<div class="container"> 
    <div class="row"> 
        <div class="col-md-10 col-md-offset-1">
        <div class="col-md-3 ">
              @include('_includes.nav.usermenu')
        </div>
        <div class="col-md-7 col-md-offset-1">
           <form method="GET" action="{{ url('search') }}">
      {{csrf_field()}}
            <div class="row">
                <div class="col-md-6">
                    <input type="text" name="search" class="form-control" placeholder="Search">
                </div>
                <div class="col-md-6">
                    <button class="btn btn-info">Search</button>
                </div>
            </div>
        </form>

        <br> 



     


            @forelse( $vehicles as $vehicule )
           
                
                    @if( $vehicule->uploads->count() > 0 )
                        <a href="{{ route('vehicles.show', $vehicule->id) }}">
                            @php
                                $upload = $vehicule->uploads->sortByDesc('id')->first();
                            @endphp
                            
                            <div style="border-style: solid; color: {{ $vehicule->adtype === 1 ? 'black' : 'blue' }} ">
                            <img src="/images/{{ $upload->resized_name }}" height="150" width="250"></a>
                           
        
                        {{ Carbon\Carbon::parse($vehicule->created_at)->diffForHumans()}} 
                            {{$vehicule->provincename}}
                          {{$vehicule->milage}}
                         
                          </div>
<br>
<hr>
@endif
               
            @empty
                <td>No Advertisment to display.</td>
            @endforelse
</div>

</div>
</div>
{{$vehicule->links()}}  //paginate showing links
</div>
@endsection

I need show pagination links in this blade file

Msoft left a reply on How Can I Put "paginate" Method In My Controller Index Function?

@Ishatanjeeb it is got following error,

BadMethodCallException

Method paginate does not exist.

Msoft started a new conversation How Can I Put "paginate" Method In My Controller Index Function?

I am going to put paginate method to view my data in my controller index function. I have been configured all things with paginate and but I am unable to guess where should I put following paginate in the index function,

paginate(10);

my index function,

public function index()
    {
      
        $vehicles = Vehicle::with('uploads')->get()->sort(function ($a, $b) {
        if ($a->adtype !== $b->adtype) {
            return $b->adtype - $a->adtype;
        }
    
        return $a->adtype
            ? ($a->updated_at->gt($b->updated_at) ? -1 : 1)
            : ($a->created_at->gt($b->created_at) ? -1 : 1);
    });
    
    return view('vehicles.index')->withVehicles($vehicles);
    }

where should I put them?