muazzamazaz

Experience

1,880

0 Best Reply Awards

  • Member Since 2 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

21st November, 2017

muazzamazaz started a new conversation Undefined Variable Template2 V5.2 • 16 hours ago

$result = User::where("device_token", "!=", "")->where("device_type", "!=", "")->get();
        $template2 = DB::table('notification_templates')->get();
        return view('admin.push_notifications', compact('result','template2'))->withPage('push_notifications')->with('sub_page', 'view-push_notifications');

view

@if(($template2))
                            @foreach($template2 as $taken)
                              
                     {{ $taken->title }}
                             
                            @endforeach
                            @endif

20th November, 2017

muazzamazaz left a reply on Undefined Variable: Template (View:... • 1 day ago

@tisuchi view code is

@foreach($template as $taken)
                              
                            {{ $taken->title }}
                             
                            @endforeach

muazzamazaz left a reply on Undefined Variable: Template (View:... • 1 day ago

@tisuchi Can you add code here where everything with with

muazzamazaz left a reply on Undefined Variable: Template (View:... • 1 day ago

@tisuchi if I use $template2 then it also show error.

muazzamazaz started a new conversation Undefined Variable: Template (View:... • 1 day ago

$result = User::where("device_token", "!=", "")->where("device_type", "!=", "")->get();
        $template = DB::table('notification_templates')->get();
        return view('admin.push_notifications', compact('result','template'))->withPage('push_notifications')->with('sub_page', 'view-push_notifications');


 @foreach($template as $taken)
                              
                            {{ $taken->title }}
                             
                            @endforeach

15th November, 2017

muazzamazaz started a new conversation No Users Found • 6 days ago

I have table users with two records but following code not getting it

use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\User;
use App\UserRating;
use Hash;
use Illuminate\Http\Request;
use Validator;
use App\Requests;

class UserController extends Controller
{


    public function users()
    {
        $user = User::orderBy('created_at', 'desc')->get();

        return view('admin.users')->withPage('users')->with('sub_page', 'view-user')->with('users', $user);
    }

....
<?php

namespace App;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Database\Eloquent\SoftDeletes;

class User extends Authenticatable
{
    use SoftDeletes;
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];
    
    /**
     * Fetch the list of recent users by creation date
     * 
     * @return User
     */
    private function fetchRecentUsers()
    {
       
        return $this->orderBy('created_at' , 'desc')->get();
    }
    
    /**
     * Returns a list of recent users by creation date
     * 
     * @return mixed
     */
    public static function getRecentUsers()
    {
        $user = new User();
        return $user->fetchRecentUsers();
    }
}

13th November, 2017

muazzamazaz started a new conversation Select Option Property Not Working • 1 week ago

<select name="notificationtype" required class="form-control">
    <option value="sms" @if($template->type=='sms') "selected=true" else "selected=false" @endif > SMS </option>
    <option value="email" @if($template->type=='email') "selected=true" else "selected=false" @endif > Email </option> 
</select>

11th November, 2017

muazzamazaz left a reply on Call To A Member Function GetUpdatedTemplate() On Null • 1 week ago

@Snapey after change it shows

No query results for model [App\Notification_Template].

muazzamazaz left a reply on Call To A Member Function GetUpdatedTemplate() On Null • 1 week ago

@andonovn

CREATE TABLE `notification_templates` (
  `id` int(11) NOT NULL,
  `type` varchar(20) NOT NULL,
  `title` varchar(200) NOT NULL,
  `email_subject` varchar(500) NOT NULL,
  `message` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

9th November, 2017

muazzamazaz started a new conversation Call To A Member Function Save() On Null • 1 week ago

    public function Save_Template(Request $request)
    {
        $templateValidation = new Notification_Template();
        $validator       = $templateValidation->getValidatedData($request);
        $template           = Notification_Template::find($request->id);

        if ($validator->fails()) {
            $error_messages = implode(',', $validator->messages()->all());
            return back()->with('flash_errors', $error_messages);
        } else {
            $template->getUpdatedTemplate($template, $request);
          
            $template->save();

            return back()->with('flash_success', Helper::tr('admin_not_profile'));
        }
    }

at above $template->save(); error throws:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Validator;

/**
 * Responsible for the Admin user
 */
class Notification_Template extends Model
{
    /**
     * Pass the data through the Laravel validator
     * 
     * @param Request $request
     * @return mixed
     */
     public function setUp() {
    parent::setUp();
    // Your code here
}
     protected $table = 'notification_templates';
     protected $guarded = ['Id'];
    protected function passDataThroughValidator(Request $request)
    {
        
           return Validator::make($request->all(), array(
                    'type' => 'max:20',
                    'email_subject' => 'max:300',                    
                    'nessage' => 'max:1000',
                    'title' => 'max:100',                   
                        )
        );
    }
    
    /**
     * Return the updated data after validation
     * 
     * @param Request $request
     * @return mixed
     */

    public function getValidatedData(Request $request)
    {
        return $this->passDataThroughValidator($request);
    }
    
    /**
     * Update the admin profile information
     * 
     * @param \App\Admin $admin
     * @param Request $request
     * @return \App\Admin
     */
    private function updateTemplate(Notification_Template $template, Request $request)
    {
        $template->type = $request->has('type') ? $request->type : $Template->type;
        $template->title = $request->has('title') ? $request->title : $Template->title;
        $Template->email_subject = $request->has('email_subject') ? $request->email_subject : $template->email_subject;
        $Template->message = $request->has('message') ? $request->message : $template->message;
        
        return $template;
    }
  
  private function savetemplateProfile(Notification_Template $template, Request $request)
    {
         $template->type = $request->has('type') ? $request->type : $Template->type;
        $template->title = $request->has('title') ? $request->title : $Template->title;
        $Template->email_subject = $request->has('email_subject') ? $request->email_subject : $template->email_subject;
        $Template->message = $request->has('message') ? $request->message : $template->message;
        
        return $template;
    }
    
    /**
     * Return the updated template profile information
     * 
     * @param \App\template $template
     * @param Request $request
     * @return mixed
     */

     public function getUpdatedtemplate(Notification_Template $template, Request $request)
    {
        return $this->updatetemplate($template, $request);
    }
    
     public function getSavetemplate(Notification_Template $template, Request $request)
    {
        return $this->savetemplate($template, $request);
    }
}

26th October, 2017

muazzamazaz left a reply on Trying To Get Property Of Non-object Error On Db View • 3 weeks ago

@RamjithAp returning it as

return view('user', compact('top_revenue_users'))
                        ->withPage('user');```

muazzamazaz left a reply on Trying To Get Property Of Non-object Error On Db View • 3 weeks ago

@Snapey it getting rows from view

muazzamazaz started a new conversation Trying To Get Property Of Non-object Error On Db View • 3 weeks ago

Getting db view results but error of non-object while view contains rows

$top_revenue_users = DB::table('user_requests')->orderBy('total', 'desc')->take(3);

ody>   
    @foreach ($top_revenue_users as $rc2)
    <tr>
    <td>{{$rc2->first_name}}</td>
    <td>{{$rc2->last_name}}</td>
    <td>{{$rc2->email}}</td>
    
    @endforeach
``

> Trying to get property of non-object 

24th October, 2017

muazzamazaz started a new conversation SyntaxError: Missing : After Property Id • 4 weeks ago

I have write the following code

 var geocoder =  new google.maps.Geocoder();
 
     var map;
     var markers = [
         @foreach($locationList as $location)
         {
             location_id: "{{ $location->id }}",
             geocoder.geocode( { 'address': "{{ $location->city }}"}, function(results, status) {
           if (status == google.maps.GeocoderStatus.OK) { 
           lat: results[0].geometry.location.lat(),
            lng: results[0].geometry.location.lng(),
           }
         }
         });
             
             
         },
         @endforeach
     ];

But it give me error

SyntaxError: missing : after property id

21st October, 2017

muazzamazaz started a new conversation Softdeletes Not Working • 1 month ago


use Illuminate\Database\Eloquent\SoftDeletes;
class UserController extends Controller
{
use SoftDeletes;


   public function delete_user(Request $request)
    {

        if ($user = User::find($request->id)) {

            $user = User::destroy($request->id);
        }

...

deletes row from table instead of updating delete_at column that exists there.

19th October, 2017

muazzamazaz started a new conversation Method [validate] Does Not Exist. • 1 month ago

namespace App\Http\Controllers;
use App\ContactUS;
use Illuminate\Http\Request;
use App\Http\Requests;
use validator;
use Illuminate\Routing\Controller as BaseController;
class ContactUSController extends BaseController
{
public function contactUS(){
return view('CityOfWorks.ContactUS');
}
public function contactUSPost(Request $request){

$this->validate($request, ['name' => 'required','email' => 'required|email','message' => 'required']);

ContactUS::create($request->all());

return back()->with('success', 'Thanks for contacting us!');
}
}

16th October, 2017

muazzamazaz started a new conversation Class 'app\Location' Not Found • 1 month ago

calling class here in controller:

use app/Location;

....


$validator = Location::getValidatedData($request);

in app folder I have class file Location with class and above function as:

namespace App\Admin;

use Illuminate\Database\Eloquent\Model;
use Symfony\Component\HttpFoundation\Request;
use Validator;

class Location extends Model
{
    public static function getValidatedData(Request $request)
    {
        $data = new Location();
        return $data->passDataThroughValidator($request);
    }
}

2nd October, 2017

muazzamazaz left a reply on Selected Option Not Working • 1 month ago

@Snapey I have confirmed that value is there. May be some trailing spaces caused it

1st October, 2017

muazzamazaz started a new conversation Selected Option Not Working • 1 month ago

I am getting selected option from db as

@foreach($admins as $index => $admin)
                  <tr>
                   
                      <td>
                      <Select name="region" class="form-control" id="region" placeholder="Region">
                                  <Option value="AS" @if ($admin->region == 'AS')  selected = "selected" @endif >Asia</option>
                                  <option value="ME" @if ($admin->region == 'ME')  selected = "selected" @endif >Middle East</option>
                                  <option value="EU" @if ($admin->region == 'EU')  selected = "selected" @endif >Europe</option>
                                  </select>
                                  </td>
@endforeach

but not showing selected option

26th September, 2017

muazzamazaz started a new conversation Route Link Parameter Error 5.4 • 1 month ago

I have following route defined with parameter

Route::get('paywithpaypal/{amount}', array('as' => 'addmoney.paywithpaypal','uses' => '[email protected]',));

when I try to get it via

return Redirect::route('paywithpaypal/1');

it through error

Route [paywithpaypal/1] not defined.

24th September, 2017

muazzamazaz left a reply on Password Reset Link Not Working 5.2 • 1 month ago

<form class="form-layout" role="form" method="POST" action="{{ url('/admin/password/email') }}">

muazzamazaz started a new conversation Password Reset Link Not Working 5.2 • 1 month ago

Route::post('password/email', 'Auth\[email protected]');

Route is not working and throughs error:

Route [user.dashboard] not defined.

class AdminPasswordController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Password Reset Controller
    |--------------------------------------------------------------------------
    |
    | This controller is responsible for handling password reset requests
    | and uses a simple trait to include this behavior. You're free to
    | explore this trait and override any methods you wish to tweak.
    |
    */

    use ResetsPasswords;

    /**
     * Where to redirect users after successful change of password.
     *
     * @var string
     */

    protected $guard = 'admin';

    protected $broker = 'admins';

    protected $redirectTo = '/admin';

    /**
     * The password reset request view that should be used.
     *
     * @var string
     */

    protected $linkRequestView = 'admin.auth.passwords.email';

    /**
     * The password reset view that should be used.
     *
     * @var string
     */

    protected $resetView = 'admin.auth.passwords.reset';

    /**
     * Create a new password controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }
}


23rd September, 2017

muazzamazaz left a reply on Call To A Member Function SaveAdminProfile() On Null • 1 month ago

@rebirthtobi

How to encrypt password field using create method and via hash

hass::make

22nd September, 2017

muazzamazaz left a reply on Call To A Member Function SaveAdminProfile() On Null • 1 month ago

@rebirthtobi but id field is Auto increment in table

21st September, 2017

muazzamazaz left a reply on Parse Error: Syntax Error, Unexpected '<' • 2 months ago

@tykus

I am passing parameter value as url and getting values accordingly but now want to pass it as hidden element for further post into db

muazzamazaz left a reply on Parse Error: Syntax Error, Unexpected '<' • 2 months ago

@tykus

{{ Route::current()->parameter('JobId')}}

I need this value as hidden field

muazzamazaz left a reply on Parse Error: Syntax Error, Unexpected '<' • 2 months ago

Same error for

@if ({{$applied}} <= {{$limit}})
                
                {!! Form::submit('Post',['class' => 'btn btn-lg btn-info'] ) !!}
                @else
                
                {!! Form::submit('Post', array('disabled'),['class' => 'btn btn-lg btn-info'] ) !!}
                @endif```

muazzamazaz started a new conversation Parse Error: Syntax Error, Unexpected '<' • 2 months ago

How to show url parameter in form element

{!! Form::hidden('JobId', $value = {{ Route::current()->parameter('JobId')}}!!}


muazzamazaz left a reply on Route [JobApplication/1] Not Defined. 5.4 • 2 months ago

@bashy

Route::get('JobApplication/{JobId}','[email protected]');
Route::post('application/','[email protected]');

in controller value is null;

$JobId  = Input::get('JobId') ; 

muazzamazaz left a reply on Call To A Member Function SaveAdminProfile() On Null • 2 months ago

@rebirthtobi

it gives now

MassAssignmentException in Model.php line 452: id

muazzamazaz left a reply on Route [JobApplication/1] Not Defined. 5.4 • 2 months ago

But I want to know how to access this parameter value in controller

$request->input('JobId'); shows null

muazzamazaz left a reply on Route [JobApplication/1] Not Defined. 5.4 • 2 months ago

{{ URL::to('JobApplication/'.$ajobs->id) }}

resolved the issue.

20th September, 2017

muazzamazaz left a reply on Call To A Member Function SaveAdminProfile() On Null • 2 months ago

@sutherland why I need id as its inserting into table with auto increment id field

muazzamazaz started a new conversation Route [JobApplication/1] Not Defined. 5.4 • 2 months ago

Route::get('JobApplication/{id}','[email protected]');

    <a href="{{ route('JobApplication/'.$ajobs->id) }}" class="jobs_title">{{ $ajobs->jobtitle }} </a>
                    

muazzamazaz started a new conversation Call To A Member Function SaveAdminProfile() On Null • 2 months ago


public function profile_save(Request $request)
    {
        $adminValidation = new Admin();
        $validator       = $adminValidation->getValidatedData($request);
        $admin           = Admin::find($request->id);

        if ($validator->fails()) {
            $error_messages = implode(',', $validator->messages()->all());
            return back()->with('flash_errors', $error_messages);
        } else {
            $admin->saveAdminProfile($admin, $request);
            
            $admin->remember_token = Helper::generate_token();
            $admin->is_activated   = 1;
            $admin->save();

            if ($request->hasFile('picture')) {
                $admin->deleteProfilePicture($admin->picture);
                $admin->picture = $admin->updateProfilePicture($request->picture);
            }
            return back()->with('flash_success', Helper::tr('admin_not_profile'));
        }
    }

  private function saveAdminProfile(Admin $admin, Request $request)
    {
        
        $admin->email = $request->has('email') ? $request->email : $admin->email;
        $admin->mobile = $request->has('mobile') ? $request->mobile : $admin->mobile;
        $admin->region = $request->has('region') ? $request->region : $admin->region;
        $admin->country = $request->has('country') ? $request->country : $admin->country;
        $admin->reg = $request->has('reg') ? $request->reg : $admin->reg;
        $admin->incharge = $request->has('incharge') ? $request->incharge : $admin->incharge;
        
        $admin->stripe = $request->has('stripe') ? $request->stripe : $admin->stripe;
        $admin->paypal = $request->has('paypal') ? $request->paypal : $admin->paypal;
        $admin->braintree = $request->has('braintree') ? $request->braintree : $admin->braintree;
        $admin->cash = $request->has('cash') ? $request->cash : $admin->cash;
        $admin->ewallet = $request->has('ewallet') ? $request->ewallet : $admin->ewallet;
        $admin->other = $request->has('other') ? $request->other : $admin->other;
        
        var_dump ($admin);
        
        return $admin;
    }

14th September, 2017

muazzamazaz started a new conversation Inside Laravel Helper Twilio Funcion Env() Function Not Working • 2 months ago

In laravel 5.2 helper file the env() function not getting values. If I put value directly then it works. Also tried getenv() function but no success.

   public static function send_twilio_sms($phone, $message)
   {
        $sid = env('TWILIO_SID');
        $token = env('TWILIO_TOKEN');
        $client = new Client($sid, $token);

        $client->messages->create(
            $phone,
            array(
                'from' => env('TWILIO_FROM'),
                'body' => $message
            )
        );
        return true;
   }

.env

TWILIO_SID=xxx TWILIO_TOKEN=xxxx TWILIO_FROM=xxxx

muazzamazaz left a reply on Twillo Not Working • 2 months ago

OK I have figured out issue:

Credentials are required to create a Client

I have put credentials in config/twilio.php but no success.

also treid

 'twilio' => [
        'account_sid' => env('TWILIO_SID'),
        'auth_token' => env('TWILIO_TOKEN'),
        'from' => env('TWILIO_FROM'), // optional
    ],

and give .env file detail but no success.

muazzamazaz left a reply on Twillo Not Working • 2 months ago

tell me its say

muazzamazaz started a new conversation Twillow Not Working • 2 months ago

use App\Helpers\Helper;

....


Helper::send_twilio_sms($phone, $message);

not sending sms and mobile app not getting message.

12th September, 2017

muazzamazaz started a new conversation Auth Controller Missing Or Path Issue • 2 months ago

Route::get('register', 'Auth\[email protected]');

AdminAuthController has only two functions (validator and create)

how to resolve this

Route [register] not defined. (View: E:\xampp\htdocs\drovit\resources\views\admin\auth\register.blade.php)

11th September, 2017

muazzamazaz left a reply on Trying To Get Property Of Non-object • 2 months ago

same code is working for users at content pages, this code is written in header file.

muazzamazaz started a new conversation Trying To Get Property Of Non-object • 2 months ago

{{Auth::guard('admin')->user()->name}}

5th September, 2017

muazzamazaz left a reply on Error : Internal Server Error • 2 months ago

@papa this happened when I have added parameter otherwise this working fine.

muazzamazaz started a new conversation Error : Internal Server Error • 2 months ago

$.ajax({
        url:'/delprofile',
        type: 'delete',
        data: {  id: 5,
                '_token': $('meta[name="csrf-token"]').attr('content')
            },
         success: function(){ alert("Record deleted.") },
    error: function(jqXHR, textStatus, errorThrown) {
        console.log(textStatus + ' : ' + errorThrown);
 }
});

Route::delete('/delprofile','[email protected]');

muazzamazaz left a reply on AJAX Error: Error : Internal Server Error • 2 months ago

add in ajax code

data: {  '_token': $('meta[name="csrf-token"]').attr('content')
            },

4th September, 2017

muazzamazaz started a new conversation AJAX Error: Error : Internal Server Error • 2 months ago

 public function delprofile (Request $request){
    
    echo 'test';
  }


Route::post('/delprofile','[email protected]');



 $.ajax({
        url:'/delprofile',
        type: 'post',
         success: function(){ alert("Record deleted.") },
    error: function(jqXHR, textStatus, errorThrown) {
        console.log(JSON.stringify(jqXHR));
        console.log("AJAX error: " + textStatus + ' : ' + errorThrown);
 }
});

31st August, 2017

muazzamazaz left a reply on Ajax Not Calling Controller Function. • 2 months ago

$.ajax({ type: "DELETE", url: '/delprofile', success:alert("Record deleted."), error: alert("Record not deleted.") });

and my route and function are as :

public function delprofile (Request $request){ DB::table('education')->where('id','=',7)->delete(); return true; }

Route::post('/delprofile','[email protected]');

muazzamazaz left a reply on Ajax Not Calling Controller Function. • 2 months ago

public function delprofile (Request $request){ DB::table('education')->where('id','=',7)->delete(); return true; }

Route::post('/delprofile','[email protected]');

`$.ajax({ type: 'POST', url: '/delprofile', data: { data : data, _method :"DELETE" },

                success : function(data){
                    console.log('ok');
                    
                },
                error: function (data) {
    //

} });`

muazzamazaz left a reply on Ajax Not Calling Controller Function. • 2 months ago

not calling route still

muazzamazaz left a reply on Ajax Not Calling Controller Function. • 2 months ago

still not calling controlling function

Edit Your Profile
Update

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