Amalmax

Amalmax

Member Since 3 Years Ago

Experience Points 16,490
Experience Level 4

3,510 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 62
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.

02 Jun
3 months ago

Amalmax left a reply on How To Send An Email To Admin After Verify The User?

@johnbraun yes, now it is working fine Thanks!!!

Amalmax left a reply on How To Send An Email To Admin After Verify The User?

@johnbraun Okey, clear but one thing is this way to import mailable to controller use Illuminate\Support\Facades\Mail;? Thanks.

Amalmax left a reply on How To Send An Email To Admin After Verify The User?

@johnbraun yes, you got My need. then I would like to know what shall I do using UserWasVerifiedMail in artisan command?

Amalmax left a reply on How To Send An Email To Admin After Verify The User?

No, any simple way without event fire.

Amalmax started a new conversation How To Send An Email To Admin After Verify The User?

I am working with Laravel 5.7 and developing a simple booking system. in my application is running following logic.

  1. user can book a taxi using booking form 2.user should be logged with email and click the verification link. 3.then after click user verification link an email should send to the admin with user data.

following as user booking and sending to user verification controller,

<?php

namespace App\Http\Controllers;
use App\Mail\VerifyMail;
use App\User;
use App\VerifyUser;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;

class UserController extends Controller
{
        protected function store(Request $request)
    {

        $user = new User;

        $user->email = $request->input('email');
        $user->name = $request->input('name');
        $user->address = $request->input('address');
        
        $user->save();

        $verifyUser = VerifyUser::create([
            'user_id' => $user->id,
            'token' => str_random(40)
        ]);

        Mail::to($user->email)->send(new VerifyMail($user));

       return redirect()->back()->with('info','We sent you an activation code. Check your email and click on the link to verify');
    }

    public function verifyUser($token)
    {
        $verifyUser = VerifyUser::where('token', $token)->first();
        if(isset($verifyUser) ){
            $user = $verifyUser->user;
            if(!$user->verified) {
                $verifyUser->user->verified = 1;
                $verifyUser->user->save();
               
                $info = "Your e-mail is verified. You can now login.";
            }else{
                $info = "Your e-mail is already verified. You can now login.";
            }
        }else{
             return redirect()->back()->with('warning', "Sorry your email cannot be identified.");
        }

         return redirect()->back()->with('info', $info);
    }
}

and email verification link view file

<!DOCTYPE html>
<html>
<head>
    <title>Welcome Email</title>
</head>

<body>
<h2>Welcome to the site {{$user['name']}}</h2>
<br/>
Your registered email-id is {{$user['email']}} , Please click on the below link to verify your email account
<br/>
<a href="{{url('user/verify', $user->verifyUser->token)}}">Verify Email</a>
</body>

</html>

but I have not an idea about step 3 to send an admin after verify user verification link. my admin email is like this [email protected] how could I manage this problem?

11 Feb
7 months ago

Amalmax left a reply on How To Use Email Verification System Without User RegistreController In Laravel?

@snapey OK, use App\Mail\VerifyMail; is this for only User Model?

Amalmax left a reply on How To Use Email Verification System Without User RegistreController In Laravel?

@snapey one thing more...can I use use App\Mail\VerifyMail; class any Controller than RegisterController?

Amalmax left a reply on How To Use Email Verification System Without User RegistreController In Laravel?

@jlrdw did you mean may I use Auth; and userRegistartion verification and customize its according to My way....

10 Feb
7 months ago

Amalmax started a new conversation How To Use Email Verification System Without User RegistreController In Laravel?

Hi, I need develop simple email verification system using Laravel. actually in My app here is not any register user or login. simply it is like this,

  1. user can fill form data and submit. 2.then form data should verify by user logged with email and save to table with verify value default "0". 3.after clicked verify email link user should received conformation message and change verify values as "1" . and should send those information to admin email address.

how can I develop this system without Auth: command and user registration controller. if there are any tutorials resources please link me. and need to know may I use Illuminate\Contracts\Auth\MustVerifyEmail without using Auth scaffold:?

Thanks.

01 Nov
10 months ago

Amalmax left a reply on Not Working Bootstrap Navbar With <ul Class=“nav Nav-sidebar”> In Laravel 5.6

@globals then what is the using sidebar class in bootstrap 4? you know that?

Amalmax started a new conversation Not Working Bootstrap Navbar With <ul Class=“nav Nav-sidebar”> In Laravel 5.6

in my laravel application I have sidebar menu like following,

<ul class="nav navbar-nav">
      <li class="{{ active_menu(Route::CurrentRouteName(), 'welcome', 0,7)}}">
      <a href="{{route('welcome')}}">Home</a></li>

      <li class="{{ active_menu(Route::CurrentRouteName(), 'page1', 0,5)}}">
      <a href="{{route('page1')}}">Page 1</a></li>
      <li><a href="#">Page 2</a></li>
      <li><a href="#">Page 3</a></li>
    </ul>

this is working with Helper.php file in app/Helper/Helper.php3

<?php

if(! function_exists('active_menu')) {
    function active_menu($currentRouteName, $requestName, $start, $finish){
        if (substr($currentRouteName,$start, $finish) == $requestName){
            return 'active';

        }else{
            return null;
        }
    }
    }

this is working fine, but now I need change above sidemenu bar class as following,

<ul class="nav nav-sidebar">

only this change but now it is not working. how can I fix this problem?

31 Oct
10 months ago

Amalmax left a reply on Why Did Not Laravel 5.6 Active Menu Item Highlight Using Request?

@lostdreamer_nl may I need some jquery thing like this,

<script>
    
   $('.nav-sidebar').on('click','li', function(){
    $(this).addClass('active').siblings().removeClass('active');
  });
</script>

my css is,

<style>
 .nav-sidebar li.active{
  /*your css code here*/
 }
</style>

Amalmax started a new conversation Why Did Not Laravel 5.6 Active Menu Item Highlight Using Request?

Hi, working with laravel 5.6 and develop sidemenu bar with bootstarp. I am using request to highlight current menu items here. but it is not highlight when it is in current menu.

<li class="{{ Request::is('products*') ? 'active' : '' }}">

    <a href="{!! route('products.index') !!}"><span>Products</span></a>

</li>


<li class="{{ Request::is('tags*') ? 'active' : '' }}">

    <a href="{!! route('tags.index') !!}"><span>Tags</span></a>

</li>


<li class="{{ Request::is('items*') ? 'active' : '' }}">

    <a href="{!! route('items.index') !!}"><span>Items</span></a>

</li>

how can I fix this problem?

25 Oct
10 months ago

Amalmax started a new conversation Why Did Not Work Js File In Laravel 5.6?

working with laravel 5.6 and I have following sidemenu bar blade file,

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">


 <div class="list-group">
   
    <a href="#" class="list-group-item active"><i class="fa fa-key"></i> <span>App Settings</span></a>
    <a href="{{route('vehicles.myads')}}" class="list-group-item" ><i class="fa fa-credit-card"></i> <span>My Ads</span></a>
    <a href="#" class="list-group-item"><i class="fa fa-question-circle"></i> <span>Support</span></a>
    <a href="#" class="list-group-item"><i class="fa fa-arrow-circle-o-left"></i> <span>Sandbox Account</span></a>
    <a href="#" class="list-group-item"><i class="fa fa-book"></i> <span>QuickStart Overview</span></a>
    <a href="#" class="list-group-item"><i class="fa fa-compass"></i> <span>Documentation</span></a>


  </div>

and css file,

.list-group {
     
     margin:auto;
     float:left;
     padding-top:20px;
    }
    .lead {
     
     margin:auto;
     left:0;
     right:0;
     padding-top:10%;
    }

and js file,

$(document).ready(function() {
  

  $('.list-group-item').click(function(e) {
    e.preventDefault();
    $('.list-group-item').removeClass('active');
    $(this).addClass('active');
  });
});

above js file is using highlight current page, and above codes using in my blade file as following,

@extends('layouts.app')
<script src="{{ url('/js/sidebar.js') }}"></script>
@section('head')
     
    <link rel="stylesheet" href="{{ asset('css/sidebar.css') }}">
@endsection
@section('content')
<div class="container"> 
    <div class="row">
    @include('_includes.nav.sidebar') 
        <div class="col-md-5 col-md-offset-1">
            @include('layouts.partials.alerts') 
@forelse( $vehicles as $vehicule )
           @if( $vehicule->uploads->count() > 0 )
                        <a href="{{ route('vehicles.show', $vehicule->id) }}">
                            @php
                                $upload = $vehicule->uploads->sortByDesc('id')->first();
                            @endphp
                            <img src="/images/{{ $upload->resized_name }}"></a>
                            {{$vehicule->provincename}}
                          {{$vehicule->milage}}
<br>
                            
<td><a class="button is-outlined" href="{{route('vehicles.edit',$vehicule->id.'/edit/')}}" >Edit</a></td>
                            <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>
                        </a> 
                    <hr>
                    @endif
               
            @empty
                <td>No Advertisment to display.</td>
            @endforelse
</div>

</div>
</div>
@endsection

but in my above file it is not highlight current blade file, what is the wrong, how can fix this?

Amalmax left a reply on Why Did Not Update Vehicle Columns Values In Laravel 5.6?

ok fix it it is some mistaken of input name in,

'tramsmission'    => 'required',

it should be

'transmission'    => 'required',
24 Oct
10 months ago

Amalmax left a reply on Why Did Not Update Vehicle Columns Values In Laravel 5.6?

@Cronix edit.blade.php file,

<div class="container">
    <div class="row">
        <div class="col-md-10">
            <form  method="post"  action="{{ route('vehicles.editvehicle', $vehicles->id)  }}" enctype="multipart/form-data">
                {{csrf_field()}}
                <div class="form-group{{ $errors->has('provincename') ? ' has-error' : '' }}">
            <label for="exampleFormControlSelect1">Province</label>
        <select name="provincename" id="provincename" class="form-control input dynamic" data-dependent="districtname" >
            <option value="{{$vehicles->provincename}}">{!! $vehicles->provincename !!}</option>
            @foreach($town_list as $town)
            
            <option value="{{$town->provincename}}">{{$town->provincename}}</option>
            @endforeach
        </select>
         @if ($errors->has('provincename'))
                    <span class="help-block">{{ $errors->first('provincename') }}</span>
                @endif
        </div>

        <div class="form-group{{ $errors->has('districtname') ? ' has-error' : '' }}">
            <label for="exampleFormControlSelect1">District</label>
           <select name="districtname" id="districtname" class="form-control input dynamic" data-dependent="townname" >
            <option value="{{$vehicles->districtname}}">{!! $vehicles->districtname !!}</option>

            
            
        </select>
         @if ($errors->has('districtname'))
                    <span class="help-block">{{ $errors->first('districtname') }}</span>
                @endif
        </div>

        <div class="form-group{{ $errors->has('townname') ? ' has-error' : '' }}">
            <label for="exampleFormControlSelect1">Town</label>
        <select name="townname" id="townname" class="form-control input">
            <option value="{{$vehicles->townname}}">{!! $vehicles->townname !!}</option>
            
        </select>
        @if ($errors->has('townname'))
                    <span class="help-block">{{ $errors->first('townname') }}</span>
                @endif
        
        </div>

         <!--hidden select box-->
        
            <div class="form-group" style="display: none;">
            <label for="exampleFormControlSelect1">Vehicle Category</label>
        <select name="categoryname" id="categoryname" class="form-control input dynamic" data-dependent="brandname" >
            
            @foreach($model_list as $model) 
            <option value="{{$vehicles->categoryname}}">{{$vehicles->categoryname}}</option>
            @endforeach
            
          
        </select>
    </div>

     

     <div class="form-group{{ $errors->has('brandname') ? ' has-error' : '' }}">
            <label for="exampleFormControlSelect1">Brand</label>

           <select name="brandname" id="brandname" class="form-control input dynamic" data-dependent="modelname" >
            <option value="{{$vehicles->brandname}}">{!! $vehicles->brandname !!}</option>
            
        </select>
        @if ($errors->has('brandname'))
                    <span class="help-block">{{ $errors->first('brandname') }}</span>
                @endif
        </div>


        <div class="form-group{{ $errors->has('modelname') ? ' has-error' : '' }}">
            <label for="exampleFormControlSelect1">Model</label>
        <select name="modelname" id="modelname" class="form-control input">
            <option value="{{$vehicles->modelname}}">{!! $vehicles->modelname !!}</option>
            
        </select>
        @if ($errors->has('modelname'))
                    <span class="help-block">{{ $errors->first('modelname') }}</span>
                @endif
        
        </div>

        <div class="form-group{{ $errors->has('year') ? ' has-error' : '' }}">
        <label for="formGroupExampleInput">Model Year</label>
        <input type="text" class="form-control" id="year" placeholder="Year" name="year" value="{!! $vehicles->modelyear ?: '' !!}">
        @if ($errors->has('year'))
                    <span class="help-block">{{ $errors->first('year') }}</span>
                @endif
        </div>

        <div class="form-group{{ $errors->has('condition') ? ' has-error' : '' }}">
        <label for="formGroupExampleInput">Condition</label>

        
        <label class="radio-inline"><input type="radio" name="condition" value="used" @if($vehicles->condition == 'used') checked @endif>Used</label>
<label class="radio-inline"><input type="radio" name="condition" value="recondition" @if($vehicles->condition == 'recondition') checked @endif>Recondition</label>
<label class="radio-inline"><input type="radio" name="condition" value="new" @if($vehicles->condition == 'new') checked @endif> New</label>
  @if ($errors->has('condition'))
                    <span class="help-block">{{ $errors->first('condition') }}</span>
                @endif
        </div>

        <div class="form-group{{ $errors->has('milage') ? ' has-error' : '' }}">
        <label for="formGroupExampleInput">Milage</label>
        <input type="text" class="form-control" id="milage" placeholder="Milage" name="milage" value="{!! $vehicles->milage ?: '' !!}">
        @if ($errors->has('milage'))
                    <span class="help-block">{{ $errors->first('milage') }}</span>
                @endif
        </div>

        <div class="form-group{{ $errors->has('transmission') ? ' has-error' : '' }}">
        <label for="exampleFormControlSelect1">Transmission</label>
        <select class="form-control" id="transmission" name="transmission">
            
            <option value="{!! $vehicles->transmission  !!}">{!! $vehicles->transmission  !!}</option>
            
        <option value="Manual">Manual</option>
        <option value="Auto">Auto</option>
        <option value="Hybrid">Hybrid</option>
        <option value="Electric">Electric</option>
        <option value="Codak">codak</option>
        </select>
        @if ($errors->has('transmission'))
                    <span class="help-block">{{ $errors->first('transmission') }}</span>
                @endif
        </div> 

        <div class="form-group{{ $errors->has('fueltype') ? ' has-error' : '' }}">
        <label for="exampleFormControlSelect1">Fuel Type</label>
        <select class="form-control" id="fueltype" name="fueltype">
            
            <option value="{!! $vehicles->fueltype  !!}">{!! $vehicles->fueltype  !!}</option>
             
        <option value="Petrol">Petrol</option>
        <option value="Diesel">Diesel</option>
        <option value="Hybrid">Hybrid</option>
        <option value="Electric">Electric</option>
        
        </select>
         @if ($errors->has('fueltype'))
                    <span class="help-block">{{ $errors->first('fueltype') }}</span>
                @endif
        </div> 

        <div class="form-group{{ $errors->has('enginecapacity') ? ' has-error' : '' }}">
        <label for="formGroupExampleInput">Engine capacity</label>
        
        <input type="text" class="form-control" id="enginecapacity" placeholder="Engine capacity" name="enginecapacity"  value="{!! $vehicles->enginecapacity ?: '' !!}" >
         @if ($errors->has('enginecapacity'))
                    <span class="help-block">{{ $errors->first('enginecapacity') }}</span>
                @endif
       
        </div>


        <div class="form-group{{ $errors->has('data') ? ' has-error' : '' }}">
        <label for="comment">More Details</label>
        <textarea class="form-control" rows="5" id="data" name="data" rows="10" cols="10">{!! trim($vehicles->detail) !!}</textarea>
        @if ($errors->has('data'))
                    <span class="help-block">{{ $errors->first('data') }}</span>
                @endif
        </div >

        <div class="form-group{{ $errors->has('price') ? ' has-error' : '' }}">
        <label for="formGroupExampleInput">Price</label>
        <input type="text" class="form-control" id="price" placeholder="Price" name="price" value="{!! $vehicles->price ?: '' !!}">
         @if ($errors->has('price'))
                    <span class="help-block">{{ $errors->first('price') }}</span>
                @endif
        </div>

        <div class="form-group{{ $errors->has('telephone') ? ' has-error' : '' }}">
        <label for="formGroupExampleInput">Telephone</label>
        <input type="text" class="form-control" id="telephone" placeholder="Telephone" name="telephone" value="{!! $vehicles->telephone ?: '' !!}" >
         @if ($errors->has('telephone'))
                    <span class="help-block">{{ $errors->first('telephone') }}</span>
                @endif
        </div>

 <!-- <button type="submit" class="btn btn-primary" style="margin-top:10px">Submit</button>
        </div> -->

        

        @if( $vehicles->uploads->count() > 0 )
                        
                            @php
                                $upload = $vehicles->uploads->sortByDesc('id')->first();
                            @endphp
                           <!--  <img id="preview" src="/images/{{ $upload->resized_name }}"> -->
                            
                   <!--edit/delete buttons-->
@foreach( $vehicles-> uploads as $upload)
                        
                    <img id="preview"
                         src="{{asset((isset($upload) && $upload->resized_name!='')?'images/'.$upload->resized_name:'images/noimage.png')}}"
                         height="200px" width="200px"/>
                    <input class="form-control" style="display:none" name="files[]" type="file" id="files" name="_token" value="{{ csrf_token() }}" enctype="multipart/form-data">
                    <br/>
                    <!-- <a href="javascript:changeProfile();">Add Image</a> | -->
                    <!-- <a style="color: red" href="javascript:removeImage()">Delete</a>
                    <input type="hidden" style="display: none" value="0" name="remove" id="remove"> -->
               <a href="/myads/{{$upload->id}}/editimage">Edit Image</a>|

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

                 <hr>
                   @endforeach
                    @endif

 <button type="submit" class="btn btn-primary" style="margin-top:10px">Submit</button>
        </div>
</form>

Amalmax left a reply on Why Did Not Update Vehicle Columns Values In Laravel 5.6?

@Cronix what did you mean What url does it send the form to? actually no any error and after click update buttons page reditect to empty page like with following urls,

http://localhost:8000/myads/15/edit  // 15 means vehicle id

Amalmax left a reply on Why Did Not Update Vehicle Columns Values In Laravel 5.6?

@Cronix I chane route name as,

Route::post('myads/{id}', [
    'uses' => '\App\Http\Controllers\[email protected]',
])->name('vehicles.editvehicle');

and form action as,

<form  method="post"  action="{{ route('vehicles.editvehicle', $vehicles->id)  }}" enctype="multipart/form-data">

but still problem is there?

Amalmax started a new conversation Why Did Not Update Vehicle Columns Values In Laravel 5.6?

working with laravel 5.6 and mysql db. I have table name with vehicles. and I have vehicle table update form as edit.blade.php in vehicles view file. edit blade file form action is,

<form  method="post"  action="{{ route('vehicles.edit', $vehicles->id)  }}" enctype="multipart/form-data">

and vehiclecontroller update function is,

public function update(Request $request, $id)
    {
         $this->validate($request, [
            'provincename'     => 'required|min:3',
            'districtname'    => 'required',
            'townname'    => 'required',
            'brandname'    => 'required',
            'modelname'    => 'required',
            'year'    => 'required',
            'condition'    => 'required',
            'milage'    => 'required',
            'data'    => 'required',
            'price'    => 'required',
            'telephone'    => 'required',
            'categoryname'    => 'required',
            'tramsmission'    => 'required',
            'fueltype'    => 'required',
            'enginecapacity'   => 'required'
        ]);
        $vehicle = Vehicle::find($id);

        $vehicle->provincename = $request->input('provincename');
        $vehicle->districtname = $request->input('districtname');
        $vehicle->townname = $request->input('townname');
        $vehicle->brandname = $request->input('brandname');
        $vehicle->modelname = $request->input('modelname');
        $vehicle->modelyear = $request->input('year');
        $vehicle->condition = $request->input('condition');
        $vehicle->milage = $request->input('milage');
        $vehicle->detail = $request->input('data');
        $vehicle->price = $request->input('price');
        $vehicle->telephone = $request->input('telephone');
        $vehicle->categoryname =  $request->input('categoryname');
        $vehicle->transmission = $request->input('transmission');
        $vehicle->fueltype = $request->input('fueltype');
        $vehicle->enginecapacity = $request->input('enginecapacity');
        $vehicle->user_id = Auth::user()->id;

        $vehicle->save();

and my update route is,

Route::post('myads/{id}/edit', [
    'uses' => '\App\Http\Controllers\[email protected]',
])->name('vehicles.edit');

my vehicle edit route is,

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

but when I click update button it is not update table values.No any error occurred.

Amalmax started a new conversation Why Did Not Redirect To Page In Update Controller?

my laravel 5.6 project I have following redirect in update function of controller,

 return redirect()->route('vehicles.myads')->with('info','Your Advertisment has been updated successfully');

and I have following route,

Route::get('myads', function(){
    return view('vehicles.myads');
})->name('vehicles.myads');

but when I update form it is not redirect to (vehicles.myads), it come back. how can fix this problem?

21 Oct
10 months ago

Amalmax left a reply on How To Fix NotFoundHttpException No Query Results For Model [App\Upload] 8

@Artak it is not change same result here......

Amalmax started a new conversation How To Fix NotFoundHttpException No Query Results For Model [App\Upload] 8

I am working with Laravel 5.6 and MySQL DB. in my application I have some form data edit link from vehicles table, My edit link is this,

{{route('vehicles.edit',$vehicule->id.'/edit/')}}" >Edit</a>

and I have vehicle images show table as uploads and relationship between Vehicle model and Upload model is like this, vehicle model

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

upload model

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

and my vehicle edit route is like this,

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

My edit blade file vehicle images showing as this,

@foreach( $vehicles-> uploads as $upload)
                        
                    <img id="preview"
                         src="{{asset((isset($upload) && $upload->resized_name!='')?'images/'.$upload->resized_name:'images/noimage.png')}}"
                         height="200px" width="200px"/>
                    <input class="form-control" style="display:none" name="files[]" type="file" id="files" name="_token" value="{{ csrf_token() }}" enctype="multipart/form-data">
                    <br/>
                    <!-- <a href="javascript:changeProfile();">Add Image</a> | -->
                    <!-- <a style="color: red" href="javascript:removeImage()">Delete</a>
                    <input type="hidden" style="display: none" value="0" name="remove" id="remove"> -->
               <a href="/myads/{{$upload->id}}/editimage">Edit Image</a>|

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

                  <hr>
                   @endforeach
                    @endif

but when i click above edit link I got following error,

NotFoundHttpException

No query results for model [App\Upload] 8  //8 this is  vehicle id

how can I fix this problem?

15 Oct
11 months ago

Amalmax left a reply on How To Update One Form Data To Different Tables?

@Cronix Thanks it is working fine....

14 Oct
11 months ago

Amalmax left a reply on How To Update One Form Data To Different Tables?

@Cronix its generated following error

 (1/1) BadMethodCallException

Call to undefined method Illuminate\Database\Query\Builder::car()

Amalmax left a reply on How To Update One Form Data To Different Tables?

@Cronix I have many to many relationship with vehicles and cars that means

in My Vehicle Model

public function cars()
    {
        return $this->hasMany(Car::class);
    }

and Car Model,

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

Amalmax started a new conversation How To Update One Form Data To Different Tables?

I am working with Laravel 5.6 and MySQL. in My app I have some data edit form and its updated values saving with 3 different tables. called vehicles, cars and upload My edit form url as following,

http://localhost:8000/myads/17/edit

number (17) is vehicle table id number, like this,

id    name         owner  
1         toyota      dane
2        BMW        peter
3        Benz         samantha
4        volvo        Alex

and car table is like this,

id     fuel    vehicle_id
1          P              1
2         D              3
3          E              2

I need update cars table data with regarding to vehicle_id , My VehicleController vehicle table data update function is like this,

public function update(Request $request, $id)
    {
        $vehicle = Vehicle::find($id);

        $vehicle->name = $request->input('name');
        $vehicle->owner = $request->input('owner');
        
        $vehicle->save();
}

now I need update cars table fuel values with same form optional values input. how can I do this in the Controller?

My fuel selection input is like this,

<div class="form-group">
        <label for="exampleFormControlSelect1">Fuel</label>
        <select class="form-control" id="fuel" name="fuel">
            @foreach($vehicles->cars as $car)
            <option value="{!! $car->fuel  !!}">{!! $car->fuel  !!}</option>
            @endforeach 
        <option value="P">Petrol</option>
        <option value="D">Diesel</option>
        <option value="H">Hybrid</option>
        <option value="E">Electric</option>
       
        </select>
        </div> 
01 Oct
11 months ago

Amalmax started a new conversation How To Connect Payment Gateway With My Laravel App

Hi, I am working with Laravel 5.6 and I need integrate some payment gateway to My localhost (wamp) for My localhost developments. In My application after the payment I need update some table values from default 0 to 1 for identify payable customers. so, please inform me good way or some tutorials or other resources to do above My task.

Thanks.

20 Sep
11 months ago

Amalmax left a reply on Not Displaying Google Charts In Laravel App

@topvillas did it but same thing here..

Amalmax started a new conversation Not Displaying Google Charts In Laravel App

Hi, I am working with laravel 5.6 and I need displaying categoryname column values in google charts of vehicles table. My blade file is as following,


    @extends('layouts.app')

    @section('content')
    <title>pie chart</title>
    <script src="{{ url('/js/jquery.js') }}"></script>
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

    

    <script type="text/javascript">
        var analytics = <?php echo $categoryname;  ?>
        google.charts.load('current', {'packages':['corechart']});

        google.charts.setOnLoadCallback(drawChart);

        function drawChart()
        {
            var data = google.visulization.arrayToDataTable(analytics);

            var options = {
                title : 'Presentage of Categories'
            };

            var chart = new google.visulization.PieChart(document.getElementById('pie_chart'));
            chart.draw(data,options);
        }
    </script>
</head>
<body>
<div class="container">
    <h3 align="center">Category Chart</h3>
    <br>

    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-heading">Percentage of Categoryies</h3>
        </div>
        <div class="panel-body">
            <div id="pie_chart" style="width:750px; height: 450px;">
                 
            </div>
        </div>
    </div>
</div>
    

</body>

@endsection

and My ChartController is as

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use DB;

class ChartController extends Controller
{
    function index()
    {
        $data = DB::table('vehicles')
              ->select(
                DB::raw('categoryname as categoryname'),
                DB::raw('count(*)as number'))
              ->groupBy('categoryname')
              ->get();
        $array[] = ['Category','Number'];
        foreach($data as $key => $value)
        {
            $array[++$key] = [$value->categoryname, $value->number];
        }
        return view('reports.pie_chart')->with('categoryname', json_encode($array));
    }
}

when I visit blade file I can see Only blade file and not displaying Google chart. How can fix this problem?

11 Sep
1 year ago

Amalmax left a reply on How To Keep Backups Data In Laravel?

@Snapey what did you mean by you could use soft deletes and only mark the project as deleted, then use withTrashed when running the report.

Amalmax started a new conversation How To Keep Backups Data In Laravel?

Hello, In My Larvel 5.6 app I have table name called "projects". with following columns name

id   projectname    data      user     type   crated_at   updated_at

but I have schedule on projects table to delete every project rows after created two weeks.

Now I need generate some reports about past three months using projects table. My problem is this according to my system every projects are deleting after created two weeks then what is the methods to generate past three months reports using projects table values?

06 Sep
1 year ago

Amalmax started a new conversation How To Display File Input Buttons Multiple Times With Image Previwe?

I am working with laravel 5.6 and I have image upload button with my form. currently it is using upload single file with image thumbanail previwe.

<div class="form-group row required"> 
            <div class="field" align="left" >
            <h3>Upload  images</h3>
            <input type="file" id="files" name="files[]" multiple />
</div>
        </div>

jquery

<script >
    $(document).ready(function() {
  if (window.File && window.FileList && window.FileReader) {
    $("#files").on("change", function(e) {
      var files = e.target.files,
        filesLength = files.length;
      for (var i = 0; i < filesLength; i++) {
        var f = files[i]
        var fileReader = new FileReader();
        fileReader.onload = (function(e) {
          var file = e.target;
          $("<span class=\"pip\">" +
            "<img class=\"imageThumb\" src=\"" + e.target.result + "\" title=\"" + file.name + "\"/>" +
            "<br/><span class=\"remove\">Remove image</span>" +
            "</span>").insertAfter("#files");
          $(".remove").click(function(){
            $(this).parent(".pip").remove();
          });
          });
        fileReader.readAsDataURL(f);
      }
    });
  } else {
    alert("Your browser doesn't support to File API")
  }
});
    
 </script>

css

input[type="file"] {
  display: block;
}
.imageThumb {
  max-height: 75px;
  border: 2px solid;
  padding: 1px;
  cursor: pointer;
}
.pip {
  display: inline-block;
  margin: 10px 10px 0 0;
}
.remove {
  display: block;
  background: #444;
  border: 1px solid black;
  color: white;
  text-align: center;
  cursor: pointer;
}
.remove:hover {
  background: white;
  color: black;
}

now I add another upload input to same form like this,

<div class="form-group row required">
            <div class="field" align="left" >
            <h3>Upload  images</h3>
            <input type="file" id="files" name="files[]" multiple />
            <input type="file" id="files" name="files[]" multiple />//new one
            </div>

            
        </div>

then first upload button can appear image thumbanail but second file input did not display thumbanails.....what is the problem. how can fix this problem?

Amalmax started a new conversation Why Did Not Appear Image Thumbanails With Two Upload Input Buttons?

I am working with laravel 5.6 and I have image upload button with my form. currently it is using upload single file.

<div class="form-group row required">
            <div class="field" align="left" >
            <h3>Upload  images</h3>
            <input type="file" id="files" name="files[]" multiple />
</div>
        </div>

jquery

<script >
    $(document).ready(function() {
  if (window.File && window.FileList && window.FileReader) {
    $("#files").on("change", function(e) {
      var files = e.target.files,
        filesLength = files.length;
      for (var i = 0; i < filesLength; i++) {
        var f = files[i]
        var fileReader = new FileReader();
        fileReader.onload = (function(e) {
          var file = e.target;
          $("<span class=\"pip\">" +
            "<img class=\"imageThumb\" src=\"" + e.target.result + "\" title=\"" + file.name + "\"/>" +
            "<br/><span class=\"remove\">Remove image</span>" +
            "</span>").insertAfter("#files");
          $(".remove").click(function(){
            $(this).parent(".pip").remove();
          });
          });
        fileReader.readAsDataURL(f);
      }
    });
  } else {
    alert("Your browser doesn't support to File API")
  }
});
    
 </script>

css

input[type="file"] {
  display: block;
}
.imageThumb {
  max-height: 75px;
  border: 2px solid;
  padding: 1px;
  cursor: pointer;
}
.pip {
  display: inline-block;
  margin: 10px 10px 0 0;
}
.remove {
  display: block;
  background: #444;
  border: 1px solid black;
  color: white;
  text-align: center;
  cursor: pointer;
}
.remove:hover {
  background: white;
  color: black;
}

now I add another upload input to same form like this,

<div class="form-group row required">
            <div class="field" align="left" >
            <h3>Upload  images</h3>
            <input type="file" id="files" name="files[]" multiple />
            <input type="file" id="files" name="files[]" multiple />//new one
            </div>

            
        </div>

then first upload button can appear image thumbanail but second file input did not display thumbanails.....what is the problem. how can fix this problem?

21 Aug
1 year ago

Amalmax left a reply on Call To A Member Function GetClientOriginalExtension() On Null

My route is also here,

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

Route::post('myads/{id}', [
    'uses' => '\App\Http\Controllers\[email protected]',
])->name('vehicles.edit');

and my controller edit function

 public function edit($id)
    {
        $vehicles = Vehicle::findOrFail($id);
return view('vehicles.edit')->withVehicles;
}

but when I click edit button error came with this url:

http://localhost:8000/myads/16 <- this is vehicle_id

Amalmax left a reply on Call To A Member Function GetClientOriginalExtension() On Null

@tykus yes I have it you can see it on my form...

Amalmax started a new conversation Call To A Member Function GetClientOriginalExtension() On Null

hello, I am working with laravel 5.6 and going to update existing image on uploads table in my edit.blade.php form, my edit view is as following,

 @if( $vehicles->uploads->count() > 0 )
                        
                            @php
                                $upload = $vehicles->uploads->sortByDesc('id')->first();
                            @endphp
                         
                            <img id="preview"
                         src="{{asset((isset($upload) && $upload->resized_name!='')?'images/'.$upload->resized_name:'images/noimage.png')}}"
                         height="200px" width="200px"/>
                    <input class="form-control" style="display:none" name="files[]" type="file" id="files" name="_token" value="{{ csrf_token() }}" enctype="multipart/form-data">
                    <br/>
                    <a href="javascript:changeProfile();">Add Image</a> |
                 

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

and my Controller update function is,

 public function update(Request $request, $id)
    {
 $photos = $request->file('files');
 
        if (!is_array($photos)) {
            $photos = [$photos];
        }
 
        if (!is_dir($this->photos_path)) {
            mkdir($this->photos_path, 0777);
        }
 
        for ($i = 0; $i < count($photos); $i++) {
            $photo = $photos[$i];
            $name = sha1(date('YmdHis') . str_random(30));
            $save_name = $name . '.' . $photo->getClientOriginalExtension(); // this is line 198
            $resize_name = $name . str_random(2) . '.' . $photo->getClientOriginalExtension();
 
            Image::make($photo)
                ->resize(250, null, function ($constraints) {
                    $constraints->aspectRatio();
                })
                ->save($this->photos_path . '/' . $resize_name);
 
            $photo->move($this->photos_path, $save_name);
 
            $upload = Upload::find($id);
            $upload->filename = $save_name;
            $upload->resized_name = $resize_name;
            $upload->original_name = basename($photo->getClientOriginalName());
            $upload->vehicle_id = $vehicle->id;
            $upload->save();
        }

and My Upload table structure is as following,

id | filename | resized_name | original_name | vehicle_id

but when I click update button this error msg occured

1/1) FatalErrorException

Call to a member function getClientOriginalExtension() on null
in VehicleController.php line 198

how can fix this problem?

12 Aug
1 year ago

Amalmax left a reply on Not Working Ajax Live Search In Laravel

@Cronix ok I change routes as following,

Route::get('/live_search','[email protected]');

Route::get('/live_search/action','[email protected]')->name('live_search.action');

now above my problem solved, but occurred new one that means now I could see live_search blade view but without 'tbl_customers' data. and not also loading bootstrap also here still display plain html page????

11 Aug
1 year ago

Amalmax started a new conversation Not Working Ajax Live Search In Laravel

I have develop live search system using ajax in laravel 5.6 app. My Controller as LiveSearch.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;

class LiveSearch extends Controller
{
    function index()
    { 
        return view('live_search');
    }

    function action(Request $request)
    {
         if($request->ajax())
         {
            $query = $request->get('query');
            if($query != '')
            {
                $data = DB::table('tbl_customers')
                      ->where('CustomerName','like','%'.$query.'%')
                      ->orWhere('Address','like','%'.$query.'%')
                      ->orWhere('City','like','%'.$query.'%')
                      ->orWhere('PostalCode','like','%'.$query.'%')
                      ->orWhere('Country','like','%'.$query.'%')
                      ->orderBy('CustomerID','desc')
                      ->get();
            }
            else
            {
                $data = DB::table('tbl_customers')
                       ->orderBy('CustomerID', 'desc')
                       ->get();
            }

            $total_row = $data->count();
            if($total_row > 0)
            {
                foreach($data as $row)
                {
                    $output .= '
                    <tr>
                    <td>'.$row->CustomerName.'</td>
                    <td>'.$row->Address.'</td>
                    <td>'.$row->City.'</td>
                    <td>'.$row->PostalCode.'</td>
                    <td>'.$row->Country.'</td>

                    </tr>

                    ';
                }

            }
            else
            {
                $output = '
                 <tr>
                 <td align="center" colspan="5"> No Data Found</td>
                 </tr>
                ';
            }
            $data = array(
              'table_data' => $output,
              'total_data' => $total_data
            );

            echo json_encode($data);
         }
    }
}

blade file as live_search.blade.php

<!DOCTYPE html>
<html>
<head>
    <title>Live Search Using Ajax</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>

    <br>
    <div class="container box">
        <h3 align="center">Live Search in Laravel using Ajax</h3><br>
        <div class="panel panel-default">
            <div class="panel-heading">Search Customer Data</div>
            <div class="panel-body">
                <input type="text" name="search" id="search" class="form-control" placeholder="Search Customers Data"/>
                <div class="table-responsive">
                    <h3 align="center">Total Data:<span id="total_records"></span></h3>
                    <table class="table table-striped table-bordered">
                        <thead>
                            <tr>
                                <th>Customer Name</th>
                                <th>Address</th>
                                <th>City</th>
                                <th>Postal Code</th>
                                <th>Country</th>
                            </tr>
                        </thead>
                        <tbody>
                            
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

</body>
</html>

<script>
    $(document).ready(function(){

        fetch_customer_data();
     
     function fetch_customer_data(query = '')
     {
        $.ajax({
            url:"{{ route('live_search.action') }}",
            method:'GET',
            data:{query:query},
            dataType:'json'
            success:function(data)
            {
                $('tbody').html(data.table_data);
                $('#total_records').text(data.total_data);
            }
        })
     }

     $(document).on('keyup','#search',function(){
       var query = $(this).val();
       fetch_customer_data(query);
     });
    });
</script>

and route.php

Route::get('/live_search','[email protected]');
Route::get('/live_search','[email protected]')->name('live_search.action');

My 'tbl_customers' table structure is,

CustomerID   CustomerName  Address  City PostalCode   Country

but when I visit using this route localhost:8000/live_search i could not see any data showing only empty page here how can fix this ?

30 Jul
1 year ago

Amalmax left a reply on How To Convert Laravel Form Collective To Normal Html Form

@Cronix @zion actually I need convert this blade file,

@extends('layout.default')
@section('css')
    <style>
        .form-group.required label:after {
            content: " *";
            color: red;
            font-weight: bold;
        }
    </style>
@endsection
@section('content')
    <div class="container">
        <div class="col-md-8 offset-md-2">
            <h1>{{isset($image)?'Edit':'New'}} Image</h1>
            <hr/>
            @if(isset($image))
                {!! Form::model($image,['method'=>'put','files'=>true]) !!}
            @else
                {!! Form::open(['files'=>true]) !!}
            @endif
            <div class="form-group row">
                {!! Form::label("image","Image",["class"=>"col-form-label col-md-3"]) !!}
                <div class="col-md-5">
                    <img id="preview"
                         src="{{asset((isset($image) && $image->image!='')?'uploads/'.$image->image:'images/noimage.jpg')}}"
                         height="200px" width="200px"/>
                    {!! Form::file("image",["class"=>"form-control","style"=>"display:none"]) !!}
                    <br/>
                    <a href="javascript:changeProfile();">Add Image</a> |
                    <a style="color: red" href="javascript:removeImage()">Remove</a>
                    <input type="hidden" style="display: none" value="0" name="remove" id="remove">
                </div>
            </div>

            
           <!--  <div class="form-group row required">
                {!! Form::label("description","Description",["class"=>"col-form-label col-md-3 col-lg-2"]) !!}
                <div class="col-md-8">
                    {!! Form::text("description",null,["class"=>"form-control".($errors->has('description')?" is-invalid":""),"autofocus",'placeholder'=>'Description']) !!}
                    {!! $errors->first('description','<span class="invalid-feedback">:message</span>') !!}
                </div> 
            </div>-->
            <div class="form-group row">
                <div class="col-md-3 col-lg-2"></div>
                <div class="col-md-4">
                    <a href="{{url('laravel-crud-image-gallery')}}" class="btn btn-danger">
                        Back</a>
                    {!! Form::button("Save",["type" => "submit","class"=>"btn
                btn-primary"])!!}
                </div>
            </div>
            {!! Form::close() !!}
        </div>
    </div>
@endsection
@section('js')
    <script>
        function changeProfile() {
            $('#image').click();
        }
        $('#image').change(function () {
            var imgPath = $(this)[0].value;
            var ext = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
            if (ext == "gif" || ext == "png" || ext == "jpg" || ext == "jpeg")
                readURL(this);
            else
                alert("Please select image file (jpg, jpeg, png).")
        });
        function readURL(input) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();
                reader.readAsDataURL(input.files[0]);
                reader.onload = function (e) {
                    $('#preview').attr('src', e.target.result);
                    $('#remove').val(0);
                }
            }
        }
        function removeImage() {
            $('#preview').attr('src', '{{url('images/noimage.jpg')}}');
            $('#remove').val(1);
        }
    </script>
@endsection

I have I mage upload box in above file as

<div class="form-group row">
                {!! Form::label("image","Image",["class"=>"col-form-label col-md-3"]) !!}
                <div class="col-md-5">
                    <img id="preview"
                         src="{{asset((isset($image) && $image->image!='')?'uploads/'.$image->image:'images/noimage.jpg')}}"
                         height="200px" width="200px"/>
                    {!! Form::file("image",["class"=>"form-control","style"=>"display:none"]) !!}
                    <br/>
                    <a href="javascript:changeProfile();">Add Image</a> |
                    <a style="color: red" href="javascript:removeImage()">Remove</a>
                    <input type="hidden" style="display: none" value="0" name="remove" id="remove">
                </div>
            </div>

then above add image button did not work with normal html form its not work function changeProfile()

Amalmax started a new conversation How To Convert Laravel Form Collective To Normal Html Form

I am working with laravel project. and need convert following laravel form collective to normal collective,

<div class="form-group row">
                {!! Form::label("image","Image",["class"=>"col-form-label col-md-3"]) !!} // need change this
                <div class="col-md-5">
                    <img id="preview"
                         src="{{asset((isset($image) && $image->image!='')?'uploads/'.$image->image:'images/noimage.jpg')}}"
                         height="200px" width="200px"/>
                    {!! Form::file("image",["class"=>"form-control","style"=>"display:none"]) !!} // need change this
                    <br/>
                    <a href="javascript:changeProfile();">Add Image</a> |
                    <a style="color: red" href="javascript:removeImage()">Remove</a>
                    <input type="hidden" style="display: none" value="0" name="remove" id="remove">
                </div>
            </div>

actually I need change this to normal html form

{!! Form::label("image","Image",["class"=>"col-form-label col-md-3"]) !!}
{!! Form::file("image",["class"=>"form-control","style"=>"display:none"]) !!}

how can I do this?

28 Jul
1 year ago

Amalmax started a new conversation How To Configure Laratrust User Controller System Diffrent Menus To Diffrent Users

Hello, In My Laravel 5.6 app I am using "Laratrust" User Controller system to manage My users. I am using laravel auth command to create my normal user registration and login system. in my system i have 3 different users 1.super administrator 2.administrator 3.normal user

but when I logged with using this 3 uses all users show same menu items. in my app.blade.php. but I need diffrent menus to these diffrent users (super administrator need usermanage link and administrator need task link). how can configure this.

app.blade.php

<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>Acxian</title>

    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
    <div id="app">
        <nav class="navbar navbar-default navbar-static-top">
            <div class="container">
                <div class="col-md-10 col-md-offset-1">
                 <div class="navbar-header">

                    <!-- Collapsed Hamburger -->
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse">
                        <span class="sr-only">Toggle Navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>

                    <!-- Branding Image -->
                    <a class="navbar-brand" href="{{ url('/') }}">
                        Acxian
                    </a>
                 </div>

                 <div class="collapse navbar-collapse" id="app-navbar-collapse">
                    <!-- Left Side Of Navbar -->
                    <ul class="nav navbar-nav">
                        &nbsp;
                    </ul>

                    <!-- Right Side Of Navbar -->
                    <ul class="nav navbar-nav navbar-right">
                        <!-- Authentication Links -->
                        @if (Auth::guest())
                            <li><a href="{{ route('login') }}">Login</a></li>
                            <li><a href="{{ route('register') }}">Register</a></li>
                        @else
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                                    {{ Auth::user()->name }} <span class="caret"></span>
                                </a>

                                <ul class="dropdown-menu" role="menu">
                                    <li>
                                        <a href="{{ route('logout') }}"
                                            onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                                            Logout
                                        </a>
                                        
                                        <a href="{{ route('manage.dashboard') }}">
                                            
                                            Manage
                                        </a>

                                         

                                        <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                                            {{ csrf_field() }}
                                        </form>
                                    </li>
                                </ul>
                            </li>
                        @endif
                    </ul>
                 </div>
                </div>
            </div>
        </nav>

        @yield('content')
    </div>

    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}"></script>
</body>
</html>

sidemenu.blade.php

<div class="wrapper">
    <!-- Sidebar -->
    <nav id="sidebar">
        <div class="sidebar-header">
            <h3>Bootstrap Sidebar</h3>
        </div>

        <ul class="list-unstyled components">
            <p>Dummy Heading</p>
            <li class="active">
                <a href="#homeSubmenu" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Home</a>
                <ul class="collapse list-unstyled" id="homeSubmenu">
                    <li>
                        <a href="#">Home 1</a>
                    </li>
                    <li>
                        <a href="#">Home 2</a>
                    </li>
                    <li>
                        <a href="#">Home 3</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#">About</a>
            </li>
            <li>
                <a href="#pageSubmenu" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Pages</a>
                <ul class="collapse list-unstyled" id="pageSubmenu">
                    <li>
                        <a href="#">Page 1</a>
                    </li>
                    <li>
                        <a href="#">Page 2</a>
                    </li>
                    <li>
                        <a href="#">Page 3</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#">Portfolio</a>
            </li>
            <li>
                <a href="#">Contact</a>
            </li>
        </ul>
    </nav>

</div>

how can configure this?

10 Jul
1 year ago

Amalmax started a new conversation Not Uploaded Successfully Dropzone Images Thumbnail

m working with dropzone image uploder in laravel. but when I drag images to dropzone box image thumbnail displaying a cross and error. how can fix this problem? my form,

@section('content')
 
    <div class="row">
        <div class="col-sm-10 offset-sm-1">
            <h2 class="page-heading">Upload your Images <span id="counter"></span></h2>
            <form enctype="multipart/form-data">
            <div class="clsbox-1" runat="server"  >
        <div class="dropzone" id="my-dropzone">
        <div class="fallback">
    <input name="file" type="file" multiple />
  </div>
        

        </div>
    </div>
            </form>
        </div>
    </div>
 
    {{--Dropzone Preview Template--}}
    <div id="preview" style="display: none;">
 
        <div class="dz-preview dz-file-preview">
            <div class="dz-image"><img data-dz-thumbnail /></div>
 
            <div class="dz-details">
                <div class="dz-size"><span data-dz-size></span></div>
                <div class="dz-filename"><span data-dz-name></span></div>
            </div>
            <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>
            <div class="dz-error-message"><span data-dz-errormessage></span></div>
 
 
 
            <div class="dz-success-mark">
 
                <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
                    <!-- Generator: Sketch 3.2.1 (9971) - http://www.bohemiancoding.com/sketch -->
                    <title>Check</title>
                    <desc>Created with Sketch.</desc>
                    <defs></defs>
                    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
                        <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>
                    </g>
                </svg>
 
            </div>
            <div class="dz-error-mark">
 
                <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
                    <!-- Generator: Sketch 3.2.1 (9971) - http://www.bohemiancoding.com/sketch -->
                    <title>error</title>
                    <desc>Created with Sketch.</desc>
                    <defs></defs>
                    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
                        <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">
                            <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>
                        </g>
                    </g>
                </svg>
            </div>
        </div>
    </div>
    {{--End of Dropzone Preview Template--}}
@endsection
08 Jul
1 year ago

Amalmax left a reply on Not Working Dropzone Js Drag And Drop Interface With Laravel 5.6

I can upload single file using current interface. but unable to upload and preview multiple images uploads at a one time