mustafaabdujalil

Experience

5,310

2 Best Reply Awards

  • Member Since 1 Year Ago
  • 0 Lessons Completed
  • 0 Favorites

7th October, 2018

mustafaabdujalil started a new conversation Grouped By • 2 weeks ago

I have table that has id , product_id , admin_id, comment ,created_at,updated_at the idea that each admin can write comment on any product if many admin wirte comment on the same product how can i get last one

example id , product_id , admin_id, comment ,created_at,updated_at 1, 2,1,hi,2018-09-30 20:01:53,2018-09-30 20:01:53 2, 2,3,hello,2018-10-02 15:01:53,2018-10-3 23:01:53

how can i get last row that has last update

27th September, 2018

mustafaabdujalil started a new conversation Pagination • 3 weeks ago

i want to get specific data from returned pagination data Example : i want to select name from product and name from pharmacy_product_size only i dont need any other data?? how can i do that


{
    "data": {
        "current_page": 2,
        "data": [
            {
                "id": 21,
                "pharmacy_id": 1,
                "product_id": 12,
                "is_approved": -1,
                "comment": null,
                "created_at": null,
                "updated_at": null,
                "product": {
                    "id": 12,
                    "name": "zaz",
                    "name_ar": "zaa",
                    "description": "zaaz",
                    "description_ar": "zazaza",
                    "category_id": 3,
                    "featured_img": "product-1537804598.png",
                    "status": null,
                    "brand_name": null,
                    "created_at": "2018-09-24 15:56:38",
                    "updated_at": "2018-09-24 15:56:38"
                },
                "pharmacy_product_size": {
                    "id": 16,
                    "pharmacy_product_id": 21,
                    "size_id": 1,
                    "price": 10,
                    "quantity": 12,
                    "sold": 0,
                    "available_stock": 12,
                    "low_stock": 5,
                    "out_stock": 0,
                    "status": 0,
                    "created_at": null,
                    "updated_at": null
                }
            }
        ],
        "first_page_url": "http://localhost:8000/api/pharmacy/1/category/3/products?page=1",
        "from": 2,
        "last_page": 20,
        "last_page_url": "http://localhost:8000/api/pharmacy/1/category/3/products?page=20",
        "next_page_url": "http://localhost:8000/api/pharmacy/1/category/3/products?page=3",
        "path": "http://localhost:8000/api/pharmacy/1/category/3/products",
        "per_page": 1,
        "prev_page_url": "http://localhost:8000/api/pharmacy/1/category/3/products?page=1",
        "to": 2,
        "total": 20
    },
    "status": "success"
}


13th September, 2018

mustafaabdujalil started a new conversation .env File • 1 month ago

i want store some variables in .env file like admin_id i use env('key','value') but when i edit variable in .env file dont update and returnold value how can i do that??

12th September, 2018

mustafaabdujalil left a reply on Apis • 1 month ago

@cmdobueno i mean how can i do that ?!!! this place for discuss not for advice ;)

mustafaabdujalil started a new conversation Apis • 1 month ago

using pagination in api request ex : send users ten per page

thanks

10th September, 2018

mustafaabdujalil started a new conversation Pusher • 1 month ago

i want to push web notification so i use pusher and set everything as i show my view


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Demo Application</title>
  </head>
  <body>

    <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="//js.pusher.com/3.1/pusher.min.js"></script>
    <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

    <script type="text/javascript">

      // if (notificationsCount <= 0) {
      //   notificationsWrapper.hide();
      // }

      // Enable pusher logging - don't include this in production
      // Pusher.logToConsole = true;

      var pusher = new Pusher('set my app key', {
          cluster: 'eu',
          forceTLS: true
        });


      // Subscribe to the channel we specified in our Laravel Event
      var channel = pusher.subscribe('status-liked');

      // Bind a function to a Event (the full Laravel class)
     console.log(channel.bind('App\Events\StatusLiked', function(data) {
          alert(data.message);
        }));

    </script>
  </body>
</html>

my event

<?php

namespace App\Events;

use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class StatusLiked implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public $username;

    public $message;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct($username)
    {
        $this->username = $username;
        $this->message  = "{$username} liked your status";
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return Channel|array
     */
    public function broadcastOn()
    {
        return ['status-liked'];
    }
}

my routes

<?php
Route::get('/', function () {
    return view('welcome');
});
Route::get('test', function () {
    event(new App\Events\StatusLiked('Someone'));
    return "Event has been sent!";
});

8th September, 2018

mustafaabdujalil started a new conversation Firebase Real Time Database • 1 month ago

how can i connect my database on server with google database direct instead of export json file ??

mustafaabdujalil started a new conversation Socket Io • 1 month ago

how can i push real time notifications with socket io in laravel ?

6th September, 2018

mustafaabdujalil started a new conversation Real Time Notifications • 1 month ago

In Firebase, should I use a real-time DB or cloud messaging for an information web page updated in real time? I hope attache link or video for that

4th September, 2018

mustafaabdujalil left a reply on Yajra • 1 month ago

what ?? @jlrdw

mustafaabdujalil started a new conversation Yajra • 1 month ago

i want to add checkbox column that can select only one row or all rows and do actions for it how can i add that ??

29th August, 2018

mustafaabdujalil started a new conversation Reset Password • 1 month ago

i want to reset password and send reset email link to emails without using make:auth any help ?

thanks

mustafaabdujalil started a new conversation Reset Password • 1 month ago

i try to send reset password link to email on local should i use server to send email ?

thanks

16th May, 2018

mustafaabdujalil started a new conversation RocketShipIT • 5 months ago

i add rocketshipit to composer.json autoload then do dump-autoload but i dont know what should i do after this steps ?? any help

30th March, 2018

mustafaabdujalil started a new conversation Identify Multi Model With Same Line • 6 months ago

how can i use use App{ LocationAddress,Location,PackageUpdate,Package,ApplicationSetting,Companies,UserInvitation,AdvancedFeature,AdvancedFeaturesPerCompany,AdvancedFeature1CustomStatusPerCompany,TagsPaymentBalance, AdvancedFeatures3SettingsPerCompany };

28th December, 2017

mustafaabdujalil started a new conversation Public APIs • 9 months ago

how can i make auth for user in public APIs , i use JWT in private APIs ?

mustafaabdujalil started a new conversation Composer Update • 9 months ago

I published my laravel app on cpanel and i want to install package on it by run command or composer update how can i do that but i cant access ssh of cpanel ??

thanks in advanced

27th December, 2017

26th December, 2017

mustafaabdujalil started a new conversation Error Page • 9 months ago

How can redirect user to home page if there is error in insert or and error with database instead of display red page with error name i want redirect user to home page ? thanks

20th December, 2017

mustafaabdujalil started a new conversation Public APIs • 10 months ago

What is public APIs and How can i generate it in laravel any article or simple examples ?

thank you in advanced

19th December, 2017

mustafaabdujalil left a reply on Cron Job • 10 months ago

thank you for your efforts my friend

mustafaabdujalil left a reply on Cron Job • 10 months ago

Command file


<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\ApplicationSetting;
use App\TagsPaymentBalance;
use App\User;
use Carbon\Carbon;

class addBalanceMonthly extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'addBalanceMonthly:addBalance';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Add Balance for users monthly';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        //
        $users = User::where('user_type',3)->get();
        $amount = ApplicationSetting::first();
        
        foreach($users as $user){
            
            TagsPaymentBalance::create([
                 'user_id' => $user->id,
                 'date_added' => Carbon::now('America/New_York'),
                 'total_tags_added' =>$amount->monthly_points,
                 'current_tags_left' =>$amount->monthly_points,
                 'expiry_date' => date('Y-m-d h:i', strtotime("+1 months", strtotime(Carbon::now('America/New_York')))),
                 'entry_type' =>1,
             ]);            
        
            
        }

        
    }
}

?>



mustafaabdujalil left a reply on Cron Job • 10 months ago

mustafaabdujalil started a new conversation Cron Job • 10 months ago

How can i run cron job on cpanel in my laravel app ? thanks in advanced

18th December, 2017

mustafaabdujalil started a new conversation Public APIs • 10 months ago

What is public APIs and How can i generate it in laravel any article or simple examples ?

thank you in advanced

16th December, 2017

mustafaabdujalil left a reply on Convert Json To Array • 10 months ago

yes i used it but still return first answer

mustafaabdujalil started a new conversation Convert Json To Array • 10 months ago

laravel return array of objects how can i convert this array to array of arrays ? this is example


{  
   "data":[  
      {  
         "id":93,
         "created_at":"2017-12-12 07:47:34"
      },
      {  
         "id":78,
         "created_at":"2017-12-11 06:51:51"
      },
   ]
}

to 

{  
   "data":[  
      [  
         "id":93,
         "created_at":"2017-12-12 07:47:34"
      ],
      [  
         "id":78,
         "created_at":"2017-12-11 06:51:51"
      ],
   ]
}

mustafaabdujalil started a new conversation Jquery Datatable With Laravel • 10 months ago

How can i use server side to display data in jquery datatable due to i have i a lot of data in database ?!

15th December, 2017

mustafaabdujalil started a new conversation Install Pacakge In Laravel App On Cpanel • 10 months ago

I have laravel app on cpanel How can i install pacakge on my app by composer ?!!!

10th December, 2017

mustafaabdujalil left a reply on IDE For Laravel • 10 months ago

thanks for all :)

mustafaabdujalil started a new conversation IDE For Laravel • 10 months ago

what is the best IDE for laravel except PHPStorm because it's paid ?

if sublime, netbeans and atom has package for laravel to help me in coding as phpstorm

thanks in advanced

6th December, 2017

mustafaabdujalil left a reply on Update Database • 10 months ago

i know this solution but i thought if there is another solution but overall thank you :) @Nash

mustafaabdujalil started a new conversation Update Database • 10 months ago

how can i update some tables in database with each request for user ?

example : if i want update last seen for user with each request he do it

thanks

3rd December, 2017

mustafaabdujalil left a reply on Swagger With Laravel • 10 months ago

thank you

mustafaabdujalil started a new conversation Swagger With Laravel • 10 months ago

How can i use Swagger with laravel ?!!

any tutorial or article ?

Thanks

28th November, 2017

mustafaabdujalil left a reply on Remove Duplicated Rows • 10 months ago

MySQL @gregrobson

27th November, 2017

mustafaabdujalil started a new conversation Remove Duplicated Rows • 10 months ago

I have more than row with the same data but different in id (because it's unique) Example : columns : id name age address first row : 1 ahmed 22 ba7ry second row : 2 ahmed 22 ba7ry

how get only first row from duplicated ???

thanks

22nd November, 2017

mustafaabdujalil started a new conversation Distinct Duplicated • 10 months ago

How distinct the query from get the duplicated data ? example : if i have two rows with the same data in all fields except id exactly is different

thanks

16th November, 2017

mustafaabdujalil left a reply on Redirect To Another Url Or Website • 11 months ago

from @tykus from controller ?

mustafaabdujalil started a new conversation Redirect To Another Url Or Website • 11 months ago

Redirect to another url or website ?!!

13th November, 2017

mustafaabdujalil started a new conversation Voyager • 11 months ago

How can i use voyager with existing database that has table users with different fields ??

thanks

7th November, 2017

mustafaabdujalil started a new conversation Laravel Validation • 11 months ago

I create ajax request and do laravel validation for parameters of this request how can i return validation errors to ajax as a json response ? Thanks

5th November, 2017

mustafaabdujalil started a new conversation Reset Password • 11 months ago

I'm using phpmailer to send email how can i update in reset password method in laravel to write it by phpmailer ??

30th October, 2017

mustafaabdujalil started a new conversation Merging • 11 months ago

I have 2 queries from different 2 tables (with different fields) i want merge them and sort by timestamp ?!!!!

this is code

$location_ids = LocationAddress::where('created_by_user_id',Auth::user()->id)->orWhere('user_email',Auth::user()->email)->distinct()->pluck('id');
    
$package_ids = Package::whereIn('reciever_id',$location_ids)->orWhereIn('sender_id',$location_ids)->pluck('id');
            
$package_notifications = PackageUpdate::whereIn('package_id',$package_ids)->where('view_status',1)->get();
            
$payment_notifications = TagsPaymentBalance::where('user_id',Auth::user()->id)->where('view_status',1)->where('expiry_date','>',$today)->get();

i want merge $package_notifications and $payment_notifications ??

mustafaabdujalil started a new conversation Union • 11 months ago

when i created union between two tables give me this error Method getBindings does not exist. ?

29th October, 2017

mustafaabdujalil left a reply on Sorting • 11 months ago

give me this error Method getBindings does not exist. ??

mustafaabdujalil left a reply on Sorting • 11 months ago

thank you all :)

mustafaabdujalil started a new conversation Sorting • 11 months ago

i merge two query and i want sort them by created_at field ??

26th October, 2017

mustafaabdujalil started a new conversation PHPMailer • 11 months ago

How can i use PHPMailer to send email if any one used it before i whop to help me ?

https://github.com/PHPMailer/PHPMailer/

Thanks

23rd October, 2017

mustafaabdujalil left a reply on Send Mail • 11 months ago

thanks @Snapey

Edit Your Profile
Update

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