Aronaman

Aronaman

Member Since 1 Year Ago

Experience Points
7,400
Total
Experience

2,600 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
6
Lessons
Completed
Best Reply Awards
1
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

Level 2
7,400 XP
Sep
21
6 hours ago
Activity icon

Started a new Conversation Laravel Laragon DataBase Open Unusually

i am working on laravel application using window app called laragon for managing my server.

my laragon , database instead of open my database redirect me to the web with http://localhost:801/adminer/ and ask me to enter a password, and username

last night it was working fine, can anybody help me!!

Sep
12
1 week ago
Activity icon

Replied to Integration Server

@automica ok ..what about i use passport "personal access token", the problem I encounter is i don't know how to retrieve and save to desktop config file.

second expired token issue

Sep
11
1 week ago
Activity icon

Replied to Integration Server

@automica tnx for the response, but I am asking 2 questions can give me some suggestion, I am not focusing on the code right now, I am lost in the concept part.

is there any documentation for this kind of scenario

Activity icon

Started a new Conversation How To Trigger Both Create And Api Request

hello guys

while adding every new recordin DB, i want to send api request .

it is possible whie the user create new record using form can send api request same time??

    public function store(Request $request)
    { 
	$org=$request->all();
        $Org = Organization::create($org);

	// here i want to send api request like this

     $client = new \GuzzleHttp\Client(["base_uri" => "http://server.test"]);

       $response = $client->post("/api/post", $Org );//it should also return (problem 1)

//redirect the normal 
return redirect()->route('Orgs.index');

   }

how can i mange both return for api and normal ??

Activity icon

Started a new Conversation Integration Server

hello guys it is the first time, i need some ideas.

there is a desktop application made using vb and I made a web app, my client wants to integrate the local DB connect with the cloud server.

what I did so far (conceptual)

create API (REST API in .Net ) for desktop application and define endpoints. then i create a restful API for the web app(laravel), then i think every user should have an API key, so i create the column "access_key" inside the user table in laravel then i generate 10 unique random digits and save it inside user table in access_key column for every user, after that i create a middleware "apiKey" check the access key belongs to the user. after that, i define the API route with the middleware.

my question is: #1my method is recommended?? or should I use laravel passport and generate personal access token??, if so where should i save personal access token in laravel ?

#2 the integration planed in both directions so, i should prepare a form in desktop to save the access_key inside the desktop configuration ?? same access_key for same user on web and desktop. on both endpoint e.g https://server.larave/api/create/access_key=As1sdgddfsdrt (it is from desktop to web) and https://desktop/api/4/update/access_key=As1sdgddfsdrt (it is from web to desktop) ??

i know i make it more complex, can any body help me thanks

Aug
17
1 month ago
Activity icon

Started a new Conversation Integration

hyy guys i finish my booking site and i want to integrate with Erp local network. the owner of the ERP ask me if i make api for my app ?

when i build the app i used api for my self, for ajax. should i make new api using laravel passport and test using postman?

is there any real world example for integration?

can any body explain in detail please and share some resource to read.

thanks in adavance

Activity icon

Replied to Email Retrieve

@automica thanks for your reply

i make it more open for users aswell as guest, i will do the logic.

one more after testing , how can i prevent no more test transaction !

thanks

Activity icon

Started a new Conversation Email Retrieve

i integrate stripe payment gateway and i have 1 question.

It is possible to retrieve " email" from the card info?

i am using test "4242424242424242". i got this value from the field:  country, brand, last4, exp_month,exp_year

and when i try the email field it is null; 

that means i have to create form field for email??

b/c i want to send email, after successfull transaction ;

thanks in Advance

Aug
15
1 month ago
Activity icon

Replied to Paypal Redirection Problem

url

https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=EC-3U955038J9995431W

calling api

Activity icon

Replied to Paypal Redirection Problem

@sinnbeck I try it, but same response ( blank page )

Activity icon

Started a new Conversation Paypal Redirection Problem

hey guys I successfully integrate with PayPal,

but, blank page responses

payment.php

  $response =  $this->provider->setExpressCheckout($data);
dd($response['paypal_link']) // its  working..  gives correct url  
 return redirect($response['paypal_link']);// but when i try redirect,.. it gives me blank page. what is the problem?

i think its b/c I accidentally run php artisan clear

.env

APP_DEBUG=true

anyone can help me, please

Aug
12
1 month ago
Activity icon

Started a new Conversation Assign Variable In Ajax

controller pass variable to blade and how can pass to ajax variable?

controller

 public function create(Request $request, Room $room)
    {
        $resultCount=2;
	$diffDate= $check_out->diffInDays($check_in);
        return view('International', compact('room','diffDate',' resultCount'));
    }

blade

 <label > Select Qty:</label><br>

<div  class="form-check">
     <select  id="qty" name="qty">
	<option value="">--- Select Qty ---</option>
		@for ($i = 1; $i < $resultCount; $i++) 
		<option value="{{$i}}">{{$i}}</option>
		@endfor
      </select>
   </div>

<h4 class="d-flex justify-content-between align-items-center mb-3">
        <span class="text-muted">Reservation Info</span>
</h4>

 <li class="list-group-item d-flex justify-content-between lh-condensed">
	 <div>
	       <h6 class="my-0">No Date</h6>      
	 </div>
	       <span class="text-muted">{{ $diffDate }}</span>
 </li>

<li class="list-group-item d-flex justify-content-between lh-condensed">
	 <div>
	         <h6 class="my-0">Quantity</h6>   
	  </div>
<!-- {{ $room->quantity }} -->
	  <span id="roomQty" class="text-muted"></span>
</li>

//ajax

$('#qty').change(function(){
	  var price=room->price;// i dont know how to assign ($price Value) 
          var noDate=diffDate; // i dont know how to assign ($diffDate  value)
	   var qty = $("#qty").val();
$.ajax(
            {
                url: "{{route('ajax.international.qtyChange')}}?qty="+qty,
                type: 'GET',
                success: function (res){
                    if(res){
                        $("#roomQty").html(res.qty);
                    }else{
                       $("#roomQty").empty();
                    }
    }
   });// ajax 
});

any help please

Jul
24
1 month ago
Activity icon

Replied to Web Application With Desktop Application

@aurawindsurfing 2 question. i am already make web application using laravel and i can make again using electron js. the second it's possible to made desktop application using electronjs and integrate with my web app using APi. my last idea what if I buy already build desktop application and try to inregrate using api? thanks in advance

Jul
22
1 month ago
Activity icon

Started a new Conversation Web Application With Desktop Application

hey guys. I developed a restaurant booking application for my client and my client needs a local network desktop application for the front desk(suitable for POS machine).

my question is should I develop a new desktop application developed using c# and integrate with my cloud API

or there is another easy way to do it (like framework suitable for the web as well as a desktop application)?

or can I change my laravel backend to local network desktop application.

I was confused can anybody help me!!

thanks for reading

Jun
25
2 months ago
Activity icon

Replied to Css And Js Mix

@sergiu17 ok. in my package.json i have already

"@popperjs/core": "^2.0.6",
"bootstrap": "^4.4.1",
"datatables.net": "^1.10.20",

and in my layout , template js and css

 <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
//js
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.4.2/cjs/popper-base.min.js"></script>

my question is should i keep both or remove from package and only clone from cdn ? b/c the template library version also different.

Jun
24
2 months ago
Activity icon

Started a new Conversation Css And Js Mix

which one prefers more?

clone my CSS and js file from cdn or install via npm and compile in my laravel mix?

 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.js"></script> 
Activity icon

Awarded Best Reply on How To Force Date Format To Dd/mm/yyyy

@noblemfd it should work

<?php

return [



    /*
    |--------------------------------------------------------------------------
    | Application Environment
    |--------------------------------------------------------------------------
    |
    | This value determines the "environment" your application is currently
    | running in. This may determine how you prefer to configure various
    | services the application utilizes. Set this in your ".env" file.
    |
    */

    'env' => env('APP_ENV', 'production'),

    /*
    |--------------------------------------------------------------------------
    | Application Debug Mode
    |--------------------------------------------------------------------------
    |
    | When your application is in debug mode, detailed error messages with
    | stack traces will be shown on every error that occurs within your
    | application. If disabled, a simple generic error page is shown.
    |
    */

    'debug' => env('APP_DEBUG', false),

    /*
     Date Format 
    */
        'date_format' => 'd/m/Y',
        'date_format_javascript' => 'DD/MM/YYYY',

it is not working, try mutators

in your model

protected $dates = [
        'created_at',
    ];

    public function getCreatedFormatAttribute()
    {  
        return $this->created_at->format('d-m-Y');
    }
  protected $appends = ['created_format'];

then in view blade do this

{{$anyVarible->created_format}}
Activity icon

Replied to How To Force Date Format To Dd/mm/yyyy

@noblemfd it should work

<?php

return [



    /*
    |--------------------------------------------------------------------------
    | Application Environment
    |--------------------------------------------------------------------------
    |
    | This value determines the "environment" your application is currently
    | running in. This may determine how you prefer to configure various
    | services the application utilizes. Set this in your ".env" file.
    |
    */

    'env' => env('APP_ENV', 'production'),

    /*
    |--------------------------------------------------------------------------
    | Application Debug Mode
    |--------------------------------------------------------------------------
    |
    | When your application is in debug mode, detailed error messages with
    | stack traces will be shown on every error that occurs within your
    | application. If disabled, a simple generic error page is shown.
    |
    */

    'debug' => env('APP_DEBUG', false),

    /*
     Date Format 
    */
        'date_format' => 'd/m/Y',
        'date_format_javascript' => 'DD/MM/YYYY',

it is not working, try mutators

in your model

protected $dates = [
        'created_at',
    ];

    public function getCreatedFormatAttribute()
    {  
        return $this->created_at->format('d-m-Y');
    }
  protected $appends = ['created_format'];

then in view blade do this

{{$anyVarible->created_format}}
Activity icon

Replied to How To Force Date Format To Dd/mm/yyyy

i dont see the full blade, i think it is datepicker , if so you should do this

if you are using a data picker or any js date.

$('.date').datepicker({
    format: '{{ config('date_format_javascript') }}'
});

or may be you just fill the date manually in your input. do this in your controller

(Carbon::parse($request->start_date)->format('j F, Y') )

in blade

<td>{{ date( config('date_format'),  strtotime($expenses->date)) }}</td>
Activity icon

Replied to Compile Css And Js

@ahmeddabak ok After i finish compile , sould i extract it ?

mix.js('resources/js/app.js', 'public/js')
   .sass('resources/sass/app.scss', 'public/css')
   .extract(['jquery', 'lodash']); 

and how to I pull it view ? using cdn ?

Activity icon

Replied to Compile Css And Js

@ahmeddabak instade of npm i used copy all css, js, image, plugin to public and test it its working, but i think it has disadvantage on fastloading right? if ur ans yes that mean i have to remove all and install via npm and import to my app.js and scss ?

Activity icon

Replied to How To Force Date Format To Dd/mm/yyyy

@noblemfd use accesor in your model or in your app.config add some code like this 'date_format' => 'd/m/Y', 'date_format_javascript' => 'DD/MM/YYYY', then pull it in all view or controller . are u from Ethiopia?

Activity icon

Started a new Conversation Compile Css And Js

hey everybody, for my front end I download template adds I copy CSS and js code to my public folder. then I access it as {{asset()}}.

my question is what is the best way to better performance (page-load). and how to use can for my template css and js.

//instead of just copy my CSS and js and compressed, I prefer using laravel mix like this

mix.js('resources/js/app.js', 'public/js')
	js('resources/js/jquery-3.3.1.min.js', 'public/js')
	js('resources/js/jquery-ui.js')
	js('resources/js/popper.min.js', 'public/js')
	js('resources/js/aos.js', 'public/js')

 .sass('resources/sass/app.scss', 'public/css')
   .sass('resources/sass/bootstrap.min.css', 'public/css')
   .sass('resources/sass/magnific-popup.css', 'public/css')

most of css and js code are static, so how can I use cdn for template driven css and js.

thanks in advance

Jun
22
2 months ago
Activity icon

Replied to Conver To Database Query Builder

@michaloravec thanks very much it help full the documentation.

I am not using laravel mix rather I minified manually and added it to the public directorate. for this case how to use cache

Activity icon

Replied to Conver To Database Query Builder

3-4 sec is very slow? right how to cache js and css

Activity icon

Started a new Conversation Conver To Database Query Builder

any help, change a given eloquent query to database query

$exchangeRate = Currency::where('currencyType', 'USD')->firstOrFail()->exchangeRate;

// change $organizations to database query 
$organizations = Organization::withCount(['rooms','confrences'])->with(['typeOfOrganization','user'])
->where('approved', 1)->when(request('type_of_organization'), function($query){ return $query->where('organizations.type_of_organization_id', 	request('type_of_organization')); })

->when($request->has(['start_price', 'end_price']), function ($query) use ($request, $exchangeRate) {
    return $query->where(function ($query) use ($request) {
      $query->whereBetween('avg_price', [
      $request->start_price, $request->end_price
     ])->where('currency_id', 1);
      })->orWhere(function ($query) use ($request, $exchangeRate) {
        $query->whereBetween('avg_price', [
        $request->start_price * $exchangeRate, $request->end_price * $exchangeRate
      ])->where('currency_id', 2);
   });
 })->get();

thanks in advance

Jun
20
3 months ago
Activity icon

Replied to How Do I Short This

@michaloravec the first is where('currency_id', 1) and the second where('currency_id',2) and the return $query where value also different. .. please see the question again.

Activity icon

Started a new Conversation How Do I Short This

it is working, but how can i short it with out using merge?

   $exchangeRateToDollar=Currency::where('currencyType','ETB')->firstOrFail()->exchangeRate;
   $startPriceDollar =$request->start_price*$exchangeRateToDollar;
   $endPriceDollar =$request->end_price*$exchangeRateToDollar;


 $organizationsETB = Organization::where('approved', 1)->where('currency_id',1)
 ->when(request(['start_price', 'end_price']), function($query) {
    return $query->where('organizations.avg_price', '>=', request('start_price'))->where('organizations.avg_price', '<=', request('end_price'));
     })->get();



 $organizationsUSD = Organization::where('approved', 1)->where('currency_id',2)
 ->when(request(['start_price', 'end_price']), function($query) use ($startPriceDollar, $endPriceDollar) {
    return $query->where('organizations.avg_price', '>=', $startPriceDollar)->where('organizations.avg_price', '<=', $endPriceDollar);
    })->get();


$organizations= $organizationsETB->merge($organizationsUSD)->paginate(21);  

Jun
19
3 months ago
Activity icon

Replied to How Can I Shorten This Code

@walidabou thanks very much. it work add use() on second function also. thanks for your help

Activity icon

Started a new Conversation How Can I Shorten This Code

it is working, but the only change is the start, end price value, how can I shorten this code without using merge

 $exchangeRateToDollar=Currency::where('currencyType','ETB')->firstOrFail()->exchangeRate;
 $startPriceDollar =$request->start_price*$exchangeRateToDollar;
 $endPriceDollar =$request->end_price*$exchangeRateToDollar;

 $organizationBirr= Organization::withCount(['rooms','confrences'])
        ->with(['typeOfOrganization','user'])->where('approved',1)
        ->when(request(['start_price','end_price']), function($query){
              return $query->where('organizations.avg_price','>=', request('start_price'))
                           ->where('organizations.avg_price','<=',request('end_price'));
            })})->get();


$organizationDollar=Organization::withCount(['rooms','confrences'])
            ->with(['typeOfOrganization','user'])->where('approved',1)
	    ->when(request(['start_price','end_price']), function($query) use ($startPriceDollar,$endPriceDollar){
                  return $query->where('organizations.avg_price','>=', $startPriceDollar)
                               ->where('organizations.avg_price','<=',$endPriceDollar);
                })->get();


 $organizations=$organizationBirr->merge($organizationDollar)->paginate(21);
Jun
15
3 months ago
Activity icon

Replied to Retrieve Value Using Helping Method Config()

it is b/c i used event and listener for fire the email? or i used the boot() method for initiating config() helper??

Activity icon

Started a new Conversation Retrieve Value Using Helping Method Config()

i register setting service provider and retrieve value from settings table using helping method config() , it's working on other blade files, but when I try on email.blade not showing up??

SettingServiceProvider

class SettingServiceProvider extends ServiceProvider
{
    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind('settings', function ($app) {
        return new Setting();
    });
    $loader = \Illuminate\Foundation\AliasLoader::getInstance();
    $loader->alias('Setting', Setting::class);

    }

    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
         // only use the Settings package if the Settings table is present in the database
    if (!\App::runningInConsole() && count(Schema::getColumnListing('settings'))) {
        $settings = Setting::all();
        foreach ($settings as $key => $setting)
        {
            Config::set('settings.'.$setting->key, $setting->value);
            Config::set('settingsImg.'.$setting->key, $setting->multi_img);
        }
    }

    }
}

on my config.app.php

'providers' => [
 App\Providers\SettingServiceProvider::class,

    ],

then on my email blade, why settings not working and app.name working?

Thanks,<br>{{config('settings.seo_meta_description')}} // null 
{{ config('app.name') }}// it is working 
Jun
11
3 months ago
Activity icon

Replied to Event And Listener

@sorry i just on wrong controller :)

Activity icon

Replied to Event And Listener

i alrady connect them in my event serviceprovider..? it this related with ajax

Activity icon

Started a new Conversation Event And Listener

my event is not triggering ??

public function store(Request $request, $blog)
{
    if($request->ajax())
     {
       $input['blog_post_id'] = $blog;
        Comment::create($input);
        event(new BlogNewCommentNotificationEvent($input));
        return response()->json(['success'=>'Successfull, Wait Untile Approve!!']);
          
     }
}

successful store the record, but not trigger the event then I tryPHP artisan queue:worknoting happen! it is b/c ajax function??

Jun
01
3 months ago
Activity icon

Started a new Conversation Merging Two Object

// two object 
$individual ={33 : "203"};
$random={11: "760", 32: "102"}
$result=$individual->merge($random);
//my result response
0 : "760"
1 : "102"
2 : "203"

how can I achieve this ??? is there another method? beside merge

$result={11:"760", 32:"102", 33: "203"};
May
11
4 months ago
Activity icon

Started a new Conversation Maximum Execution Time Of 60 Seconds Exceeded

Room.php

 protected $appends = [
        'room_gallery',
        'room_feature_image', 
        'dollar_room_price',
        'birr_room_price', 
    ];


  public function getDollarRoomPriceAttribute()
        {
            if($this->organization->currency->symbol=='ETB'){
                $dollarRate=Currency::where('currencyType','ETB')->first()->exchangeRate;//0.029
                $fromEtbToUsd=$this->room_price *$dollarRate;
                return $fromEtbToUsd;       
            }

        }


        public function getBirrRoomPriceAttribute()
        {
            if($this->organization->currency->symbol=='USD'){

                $etbRate=Currency::where('currencyType','USD')->first()->exchangeRate; //33.38
                $fromUsdToEtb=$this->room_price *$etbRate;
                return $fromEtbToUsd;
            }
        } 

conroller

public function roomIndex()
   {
   	
   	 $listRooms =Room::withCount('individualRooms')->paginate(30);
          dd($listRooms); // noting dollar_room_price or birr_room_price
   	 return view('list_rooms', compact('listRooms'));
   }

what is wrong?? any help, thanks

Apr
25
4 months ago
Activity icon

Started a new Conversation Package Remove

i install package via composer and now i would like to remove

i do

composer remove bjuppa/laravel-blog

then my blog page and my controller confused, so I go to vendor directory there is bjuppa folder, then i delete the folder from the vendor.

now i have this "c/BlogServiceProvider.php): failed to open stream: No such file or directory" error.

in laravel 6: service providers automatically attached. i don't know where it locates. i try config/app

any help please

Apr
17
5 months ago
Activity icon

Started a new Conversation Authentication

hello everybody

I want extra protection for setting Page in Admin.

#1: All sensitive information is on the setting page. I am thinking of setting a static email inside the code.

After the admin login, then try to access the setting page send a link to email(static), then after if the admin login to email then click the link redirect to setting page, but I don't have any idea how can I make this ??

I know what you think :) I need this b/c accidentally if another person get admin password can destroy the web, so all setting (sensitive information can be change after email login ).

any suggestion or help, thanks

Activity icon

Started a new Conversation Setting Page

hello guys, I was reading this article "https://www.larashout.com/settings-section-part-2"

and I have one question save sensitive information into db is not advisable right? , so how can I save my sensitive information from setting field forms to config and .env?

any help, thanks

Apr
15
5 months ago
Activity icon

Awarded Best Reply on Number_format

for though of you! face similar problem

first, make sure your response is number not string

//for example 
"<td>"+row.price+"</td>" // 1000.00
// if it response string make sure change to number 
"<td>"+Number(row.price)+"</td>"

the second using jquery format the number

"<td>"+row.price.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,')+"</td>" // 1,000.00

i hope it help some one:)

Activity icon

Replied to Number_format

for though of you! face similar problem

first, make sure your response is number not string

//for example 
"<td>"+row.price+"</td>" // 1000.00
// if it response string make sure change to number 
"<td>"+Number(row.price)+"</td>"

the second using jquery format the number

"<td>"+row.price.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,')+"</td>" // 1,000.00

i hope it help some one:)

Apr
13
5 months ago
Activity icon

Started a new Conversation Sum Ajax

html

<tbody id="tBody"></tbody>
 <tfoot>
   <tr>
     <th class="text-center" colspan="9">Grand Total Payment Price</th>
     <th id="grand_total"></th>
   </tr>
</tfoot>

ajax

success:function(res){ 
var bodyData = '';
 var i=1;
 var=grandTotal=0;
 $.each(res,function(index,row){ 
bodyData+='<tr id="row_'+rowCount+'" >'
.......
+'<td id="sum_'+row.id+'">'+row.discount_price_on_web+"</td><td>"
...
bodyData+="</tr>";
}

 $("#tBody").append(bodyData);

my question is all the list working fine, but how can i sum the "list discount_price_on_web" and save in html id="grand_total"?

i try this after bodyData+=""

 $("[id*=sum]").each(function(){
    grandTotal=grandTotal+parseFloat($(this).html());
         });
   $("[id*=grand_total]").html(grandTotal.toString());

Not Working !! any help

Apr
11
5 months ago
Activity icon

Replied to Number_format

@nakov noting change I was expecting like this "1,204.25"

Apr
10
5 months ago
Activity icon

Started a new Conversation Number_format

hello guys, how to format a number in number format in ajax response?

controller

<td>{{number_format($booking->group_fund,2)}}</td>

on ajax response How ??

"<td>"+row.unpay+"</td><td>"+row.fund+"</td>"
Apr
05
5 months ago
Activity icon

Replied to Notification

easy to make it mark as read !! how can i make mark as read in controller.

and how to add count number in the top of the bell button !

Activity icon

Replied to Notification

header blade

 <!-- Notification for Admin Panel  -->
         <div class="an-notifications" id="notify">
            <div class="btn-group an-notifications-dropown notifications" >

                @if (count(auth()->user()->unreadNotifications) > 0 ) 

                <button type="button"  class="an-btn an-btn-icon dropdown-toggle js-has-new-notification" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="notif">
                    <i class="fas fa-bell"></i>
                </button>

                @elseif (count(auth()->user()->unreadNotifications) === 0 ) 

                <button type="button"  class="an-btn an-btn-icon dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="notif">
                    <i class="fas fa-bell"></i>
                </button>

                @endif

            <div class="dropdown-menu">
                <p class="an-info-count">Notifications <span>{{count(auth()->user()->unreadNotifications)}}</span></p>
                <div class="an-info-content notifications-info notifications-content">

                <ul class="nav">
                    <li>
                        @forelse(auth()->user()->unreadNotifications as $notification)

                            <div class="an-info-single unread" id="notif">
                                <a href="{{url('iaccs-hook-list')}}">
                                    <span class="icon-container important">
                                        <i class="icon-setting"></i>
                                    </span>
                                    <div class="info-content">
                                       <a class="user-name">Funding Request</a>
                                       <p class="content"><i class="icon-clock"></i> {{$notification->data["amount"]}}-Amount</p>
                                    </div>
                                </a>
                            </div>
                            @empty
                            <a href="">No Unread Notification</a>

                        @endforelse
                     </li>
                </ul>

            </div> <!-- end .AN-INFO-CONTENT -->
        <div class="an-info-show-all-btn">
             <a class="an-btn an-btn-transparent fluid rounded uppercase small-font" href="#">Show all</a>
        </div>
    </div>
  </div>
</div> <!-- end .AN-NOTIFICATION -->

it is working but i dont know to related with my controller

Controller

 public function sendAdminNotification()
    {
    	$notification=tab(auth()->user()->unreadNotifications()->limit(5)->get()->toArray())->markAsRead();
    	
    }

any ???

Activity icon

Replied to Notification

its better if it is change dynamic /change by its own, but it also ok change by page load , i dont need pusher for that!

Activity icon

Started a new Conversation Notification

hello, guys i want to implement life time notification using pusher on bell icon on my dashboard. i save my notification on my database.

my question is all tutorial i found in internet is using vue or react js library, but my project is only laravel and some jquery , so how can i achieve ??

#2 i am lost how i connect my controller with the bell icon on the dashboard.

any recommendation tutorial (not using vue or react ).

thanks