mvd

Hire Me

Experience

23,250

10 Best Reply Awards

  • Member Since 2 Years Ago
  • 167 Lessons Completed
  • 2 Favorites

20th June, 2018

mvd left a reply on How To Downgrade Bootstrap Version To 3.3.7 In Laravel 5.6? • 2 days ago

@frumentius you can set the icon path with variable '$icon-font-path', in resources/assets/sass/_variables.scss

19th June, 2018

mvd left a reply on How To Downgrade Bootstrap Version To 3.3.7 In Laravel 5.6? • 3 days ago

@frumentius do the changes in the js/css files in the resources/assets/ directory

mvd left a reply on How To Pass Multiple Values Through Ajax In Laravel? • 3 days ago

whats wrong in this??

Can you give us all the code of method 'search_name'

another doubt my function has just one variable $request

This is an object, variables $request->search_name, $request->search_area, $request->search_booth are in it.

18th June, 2018

mvd left a reply on To Retrieve The Array Value From Database To My View Blade • 4 days ago

@Niyaz did you pass the $statusInfo array from your controller to your view? Something like

return view('view_name', ['statusInfo' => $statusInfo ....

i did as per your code used switch, case, breaks in every line Which version of Laravel do you use?

mvd left a reply on To Retrieve The Array Value From Database To My View Blade • 4 days ago

@Niyaz did you set each switch, case, breaks etc on a new line just like my code?

mvd left a reply on To Retrieve The Array Value From Database To My View Blade • 4 days ago

Hi @Niyaz ,

Try to use the code tags, it's hard to read your code. https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

Use the switch statement

@foreach( $request->request_status as $status)

    @if (!$status)
        None of them is selected
    @else    

        @switch ($status)
            @case(5)
                Re-activation, Additional Access, Lost, Damaged, Replacement
                @break
            @case(4)
                Re-activation, Additional access, Lost, Damaged
                @break
            @case(3)
                Re-activation, Additional access, Lost
                @break
            @case(2)
                Re-activation, Additional access
            @case(2)
                Re-activation, Additional access
            @default
                Re-activation
        @endswitch
        
    @endif    
@endforeach 

mvd left a reply on How Can I Add A New Item In One-to-many Relation While Updating • 4 days ago

Hello @jenya ,

You could give new textarea's another field name, example 'new_textarea[]' In your update controller add another for loop

foreach($request->input('new_textarea') as $newTextarea) {
$newCard = new Card();
$newCard->control_id_here = $request->input('control_id');
$newCard->textarea_value = $newTextarea;
$newCard->save();
}

mvd left a reply on How To Update Approved From 0 To 1 In Laravel • 4 days ago

Also check the relationship, see the post from @Snapey

mvd left a reply on How To Update Approved From 0 To 1 In Laravel • 4 days ago

@irankhosravi did you realy changed $submitApplication to $submit_application in your controller function 'update' ?

If so, can you give us the output from


public function update(Request $request, SubmitApplication $submit_application)
{
dd($submit_application);
}

Other option is to use the $submitApplication as id

public function update(Request $request, $submitApplication) {

$submitApplication = SubmitApplication::findOrFail($submitApplication)
$submitApplication->approved = 1;
$submitApplication->save();
return redirect()->back();
}


mvd left a reply on How To Update Approved From 0 To 1 In Laravel • 4 days ago

@irankhosravi Did you tried my code (update your controller) ?

mvd left a reply on How To Update Approved From 0 To 1 In Laravel • 4 days ago

@mballaag his code is correct but the variable '$submitApplication' needs to be '$submit_application' for the route model binding

mvd left a reply on How To Update Approved From 0 To 1 In Laravel • 4 days ago

Hello @irankhosravi,

I think a model binding problem. Can you change your controller to

public function update(Request $request, SubmitApplication $submit_application)
{
  $submit_application->approved = 1;
  $submit_application->save();
  return redirect()->back();
}

mvd left a reply on How To Downgrade Bootstrap Version To 3.3.7 In Laravel 5.6? • 4 days ago

@frumentius 6 is 'wrong', if you make a change in your js/scss files in the asset directory, public/css/app.css will be over overwritten.

14th June, 2018

mvd left a reply on How To Downgrade Bootstrap Version To 3.3.7 In Laravel 5.6? • 1 week ago

@frumentius, yes 'npm install' needs to be enough. But what do you mean with 'did not work' ?

You can check the boostrap version in /node_modules/bootstrap/package.json

mvd left a reply on How To Pass Multiple Values Through Ajax In Laravel? • 1 week ago

Name function in your controller? I only changed your $sales query in the search_name function

public function search_name( Request $request )

{
                    $output="";

                    $sales = Sales_details::where(function ($query) use ($request->search_name, $request->search_area, $request->search_booth) {

    // Name.
    if (!empty($request->search_name)) {
      $query->orWhere('customer_name', 'LIKE', '%' . $request->search_name . '%');
    }

    // Area.
    if (!empty($request->search_area)) {
      $query->orWhere('customer_area', 'LIKE', '%' . $request->search_area . '%');
    }

    // Booth.
    if (!empty($request->search_booth)) {
      $query->orWhere('customer_booth', 'LIKE', '%' . $request->search_booth . '%');
    }

})->paginate(10);
    
    if($sales)

    { 
        //Need to return the output to the ajax
    }
    else
    {
        // Need to perform some thing
    }
}

$query is a grouping functionlity, see https://laravel.com/docs/5.6/queries Section 'Parameter Grouping'

mvd left a reply on How To Pass Multiple Values Through Ajax In Laravel? • 1 week ago

Hello AbdulBazith,

Add a onkeyup eventon all the search fields?

data:{
    'search_name':$value1
    'search_area':$value2
    'search_booth':$value3
},

In your controller something like this (not tested)

    $sales=Sales_details::where(function($query) use ($request->search_name, $request->search_area, $request->search_booth) {

      // Name.
      if (!empty($request->search_name)) {
        $query->orWhere('customer_name', 'LIKE', '%' .  $request->search_name .'%');
      }

      // Area.
      if (!empty($request->search_area)) {
        $query->orWhere('customer_area', 'LIKE', '%' .  $request->search_area .'%');
      }

      // Booth.
      if (!empty($request->search_booth)) {
        $query->orWhere('customer_booth', 'LIKE', '%' .  $request->search_booth .'%');
      }

    })->get();

mvd left a reply on How To Downgrade Bootstrap Version To 3.3.7 In Laravel 5.6? • 1 week ago

Hi Frumentius,

After you changed the package.json file, did you rebuild the packages?

9th June, 2018

mvd left a reply on Send Notification • 1 week ago

Test your smtp connection variables for production?

8th June, 2018

mvd left a reply on Passing Data From Blade To Controller Through AJAX • 2 weeks ago

Typo in your controller name? Other option, do you use CSRF tokens?

mvd left a reply on Default Timezone In Lumen • 2 weeks ago

Hi Jije,

What is every solution? Also tried a 'DB_TIMEZONE' variable in your .env file?

mvd left a reply on How To Add Column’s Values In Laravel? • 2 weeks ago

Hi @AbdulBazith

Does this work?

$no=20;

Overallstock::where('date', $date)->update([
    'balance_milk' => DB::raw("balance_milk - {$no}")
]);

mvd left a reply on Send Notification • 2 weeks ago

Hi

Are your sure the setting are good? Also no errors? Example,

/**
 *  Send Mail from Parts Specification Form
 */
public function sendMail(Request $request) {
    $data = $request->all();

    $messageBody = $this->getMessageBody($data);

    Mail::raw($messageBody, function ($message) {
        $message->from('[email protected]', 'Test mail');
        $message->to('[email protected]');
        $message->subject('Test email');
    });

$fail = Mail::failures();
if(!empty($fail)) {
 throw new \Exception('Could not send message to '.$fail[0]);
}


    // otherwise everything is okay ...
    return redirect()->back();
}

6th June, 2018

mvd left a reply on Trying To Get Property Of Non-object Eager Loading • 2 weeks ago

code?

mvd left a reply on Laravel: Any Route Starting With The Letter 'a' Throws Error • 2 weeks ago

What is the error? Can you show us the .htaccess and the route code?

18th April, 2018

mvd left a reply on Unable To Init From Given Binary Data - Intervention Image • 2 months ago

Hi Siusiak1000,

You did not set the

base64_decode();

to a variable.

Try this

$project = Project::findOrFail($id);
$path = asset('storage/projects/' . $project->n_img);
$path2 = base64_decode($path);
$img = Image::make($path2);
return $img->fit($x, $y)->response('jpg', $quality);
````




17th April, 2018

mvd left a reply on Pivot Table • 2 months ago

Hi Ztioge,

That is one option, ore you can use the query builder https://laravel.com/docs/5.6/queries

mvd left a reply on Can't Get JQuery LightSlider To Work With JQuery ImageGallery • 2 months ago

Are there errors on your internet browser console (f12, and fn 12 on a mac) ?

mvd left a reply on Store URL, Then Return Back After A Redirect. • 2 months ago

You can also add a url param in the url to 'this then sends the user, to the new group page. ' If the param exist, create a hidden field. If the group is created you check if the hidden field exist. If this is the case, redirect to 'create group page' if not redirect to the 'show page'.

mvd left a reply on Mail Sent In Spam But Not Notifications • 2 months ago

Hi Heady,

Try https://www.mail-tester.com to see whats wrong.

mvd left a reply on Can't Get JQuery LightSlider To Work With JQuery ImageGallery • 2 months ago

Hi GKMelbo,

I don't have expierence with jQuery lightSlider but

<script src="js/lightslider.min.js"></script>

is loaded before Jquery. Try to add this script also in footer.

mvd left a reply on Store URL, Then Return Back After A Redirect. • 2 months ago

Hi Mick,

A session is fine but you can also store the last url in a hidden form where you create the new group.

{{  Form::hidden('url',URL::previous())  }}

After the form is submit you can use the 'url' variable in the redirect.

12th April, 2018

mvd left a reply on SQL Injection • 2 months ago

You can use the framework as you wish ;) But with the laravel query builder you can prevent sql injection.

$users = DB::select('select * from users where active = ?', [1]);

The first argument passed to the select method is the raw SQL query, while the second argument is any parameter bindings that need to be bound to the query. Typically, these are the values of the where clause constraints. Parameter binding provides protection against SQL injection.

View the docs, https://laravel.com/docs/5.6/database

mvd left a reply on Checkout • 2 months ago

Hi Davy_yg,

Is there some authentication in your controller 'HomeController' or in your route file for this? Maybe /checkout is already registered by another function? You can check this with

php artisan route:list

mvd left a reply on Unable To Install Voyager On A Freshly Installed Laravel 5.6 • 2 months ago

@abudo 5.6 is NOT supported yet. But there is a dev version for Voyager, https://github.com/the-control-group/voyager/issues/2650#issuecomment-364951757

composer require tcg/voyager:dev-1.x-dev

this is only meant for test as the dev branch is obviously not stable, use it at your own risk

11th April, 2018

mvd left a reply on Unable To Install Voyager On A Freshly Installed Laravel 5.6 • 2 months ago

Hi Abudo,

Laravel 5.6 is not supported yet.

Laravel Admin & BREAD System (Browse, Read, Edit, Add, & Delete), supporting Laravel 5.4 and 5.5! https://github.com/the-control-group/voyager

mvd left a reply on Auth2 Login From Gmail And Facebook • 2 months ago

Hi Abudo,

Check Laravel Socialite, https://github.com/laravel/socialite

Laravel Socialite provides an expressive, fluent interface to OAuth authentication with Facebook, Twitter, Google, LinkedIn, GitHub and Bitbucket. It handles almost all of the boilerplate social authentication code you are dreading writing.

mvd left a reply on Track User Activities And Requests? • 2 months ago

Hi Lyonio,

You can also look to laravel-activitylog, https://github.com/spatie/laravel-activitylog

Is it only for testing you can also use logging functionlity from Laravel core, https://laravel.com/docs/5.6/logging#introduction

mvd left a reply on Routing Problem, Single Route Not Found • 2 months ago

@rin4ik if a view not exists you see the message 'Whoops, looks like something went wrong. ', (not, 'Sorry, this page cannot be found' with a 404.')

I think the problem is in your route file. U gues page /articles/create goes to controller show ?

Route::get('/articles/{article}', '[email protected]');

mvd left a reply on Json Response Question • 2 months ago

@rin4ik

return [
    'test' => 'hello world'
];

Content-Type header is also application/json.

28th March, 2018

mvd left a reply on Unserialize(): Error At Offset 12267 Of 12278 Bytes • 2 months ago

If you mean the cache dir in your Laravel project, php artisan cache:clear

Or is it a cache folder outside your Laravel project?

mvd left a reply on Unserialize(): Error At Offset 12267 Of 12278 Bytes • 2 months ago

'Did you check that you have free space?'

Check this topic for more info, https://laracasts.com/discuss/channels/laravel/out-of-free-disk-space-when-running-on-digital-ocean?page=1

22nd March, 2018

mvd left a reply on Best Way To Do This Feature • 3 months ago

Hi,

I think this is what you want?

If it can help anyone. It seems that regex DOES NOT WORK in forwards.

But it works fine in filters (cpanel > Account Level Filtering). Hence I was able to make my wildcard in the following manner:

prefix_.+@domain.com

hence all email like those will be redirected to the address of my choice

[email protected] prefix_1245@domain.com [email protected]

good luck!

https://forums.cpanel.net/threads/forwarding-emails-by-wildcard-name-domain-com.115889/#post-520561

14th March, 2018

mvd left a reply on Using Intervention Image With Laravel Default Store Method • 3 months ago

Hi D3cypher,

On top

use Intervention\Image\Facades\Image;

And in the method

$path = public_path('medicines/'.$fileName);
$thumb = Image::make($path);
$thumb->widen(350);
$thumb->save(public_path('/thumb/' . $fileName));

mvd left a reply on Can We Host Two Or Three Laravel 5.4 Websire On Shared Hosting ? • 3 months ago

No one can answer this for you without the server details from your shared hosting. Contact the hosting and ask them :)

Here you find the server requirements for Laravel 5.4, https://laravel.com/docs/5.4/installation#server-requirements

mvd left a reply on Multiple Templates With Different Styles • 3 months ago

Hi Christiangerdes,

You can do this with yield and sections

app.blade.php

<!DOCTYPE html>
<html lang="da">
    <head>
        <meta name="csrf-token" value="{{ csrf_token() }}">
    @yield('css')
    </head>
    <body>
        <div id="app">

login-template.

<template>
    <div id="app-basic">
        <router-view></router-view>
    </div>
</template>

@section('css')
<style src="logincss.css"></style>
@endsection

mvd left a reply on Laravel - Follow A Collection Of Routes In Order • 3 months ago

Hi Rainieren,

There are multi ways to do this but a easy way is to use Jquery steps, http://www.jquery-steps.com/Examples

If the data depends on the values from a previous step you can also do this in a controller.

  • Redirect each step to the same controller method.
  • Check in this method the step from session or values from the database. If there are no values, this is step 1. Load the form.
  • Submit the form and save the data in a session or in the database, redirect to controller method to load the next form.

Something like:

public function MultiStepForm() {
        
        $step = isset($checkForSession) ? $checkForSession['step'] : 1;
        
        switch($step) {
            case 1:
                return view('form_1');
                break;
            case 2:
                return view('form_2');
                break;
            default:
                return view('form_complete');
        }
    }

13th March, 2018

mvd left a reply on New Assets Folder In /public Giving 404 Error • 3 months ago

@ixenox so the path is not correct to the css. No typo, server/.htaccess config issue?

mvd left a reply on New Assets Folder In /public Giving 404 Error • 3 months ago

Hi Ixenox,

Code seems fine. Is the path to 'main.css' correct (view page source in your browser) ?

mvd left a reply on For Custom Validation, How To Change The Validation File In Custom File • 3 months ago

Hi Rabbiregfire,

What is the reason behind this?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.