Skip to content
Snippets Groups Projects
Select Git revision
  • syifan-v3-patch-69460
  • pipesim
  • v3 default protected
  • mod-inst
  • 329-merge-emulation-changes-from-navi_disasm_-branch
  • v3_v4_CodeObject_Migration
  • no-klo
  • navi_disasm_
  • 325-magic-memory-copy-may-impact-kernel-execution-time
  • 326-support-accelsim-trace
  • one-kernel
  • autotune-rdna2
  • autotune-cdna
  • akitartm-sa-high-concurrency
  • 309-reporting-cpi-stack-3
  • generic_lmf
  • autotune-gcn3
  • 309-reporting-cpi-stack
  • add_unified_GPU_test
  • navi_disasm_server_dev
  • v3.0.0-alpha.9
  • v3.0.0-alpha.8
  • v3.0.0-alpha.7
  • v3.0.0-alpha.6
  • v3.0.0-alpha.5
  • v3.0.0-alpha.4
  • v3.0.0-alpha.3
  • v3.0.0-alpha.2
  • v3.0.0-alpha.1
  • v2.0.2
  • v2.0.1
  • v2.0.0
  • v1.10.2
  • v1.10.1
  • v1.10.0
  • v1.9.0
  • v1.8.3
  • v1.8.2
  • v1.8.1
  • v1.8.0
40 results

runner

  • Clone with SSH
  • Clone with HTTPS
  • StyleCI

    Documentation


    What Does This Package Do?

    This package basically provides "Currency CRUD" and "A Helper Which is Helps You to Choose Your Currency In FrontSide And Stores As Session" so you dont need to worry about managing your currencies

    Installation

    Step 1

    composer require azizyus/currencymanager

    Step 2

    Add
    CurrencyManager\CurrencyManagerServiceProvider::class,
    Former\FormerServiceProvider::class,
    
    to config/app.php

    Step 3 (Migrations)

    php artisan vendor:publish --tag=azizyus/currencymanager-publish-migrations
    Im already loading migrations with ->loadMigrationsFrom, but if it doenst work just publish them and use it
    (that means you can migrate without publishing but in case if you want to override or etc... just do it as i said)

    Config File

    php artisan vendor:publish --tag=azizyus/currencymanager-publish-config


    return [ 'usePackageRoutes' => true, 'middleWares' => ['web'], 'prefix' => 'currency', 'frontPrefix' => 'currency_front', 'frontMiddlewares' => ['web'], 'controllerNamespace' => 'CurrencyManager\Controllers', 'frontControllerNamespace' => 'CurrencyManager\Controllers', ];

    As i mentioned at first, this package helps you too choose your currency in frontside so you have some config parameters about them, you can change both of middlewares and prefixes or namespaces

    Routes

    I'm using Route::resource routes for crud operations for default and they are;
    currency.index
    currency.edit
    currency.update
    currency.create
    currency.store
    currency.delete
    and because of these also you need to pass {{method_fields(' ')}} if you want to customize package also there is front routes to change your currency;


    route("currency.change",["id"=>"_YOUR_CURRENCY_ID"]);
    route("currency.current");
    last one shows your current currency as json for more like testing purposes i dont think anyone want to use that

    Controllers

    You will be have 2 controller in package; CurrencyController, which is gives crud operations and CurrencyFrontController and this one gives you currency changing feature, you can inheritance them and change some specific parts of like a edit page's view file or you can pass a modified repository with some of your specific operations

    FAQ

    What does CurrencyHelper do?

    It manages your selected currency via sessions for you, all you need is; take instance and ->getCurrencyOrDefault(); and if you dont have any error ($currencyHelperInstance->errorThrower->hasError) you can use your currency safely

    I want to exchange my currency with another one what to do?

    I got CurrencyExchangeCalculator for that, pass your base and target currency Instances to ctor and ->setPrice(); then you can calculate right price by ->baseToTarget();

    I need to use my own controllers what to do?

    Just extend one of my controllers and currencyManager config file should look like this;
    return [
        'usePackageRoutes'         => true,
        'middleWares'              => ['web'],
        'prefix'                   => 'currency',
        'frontPrefix'              => 'currency_front',
        'frontMiddlewares'         => ['web'],
        'controllerNamespace'      => "App\\Http\\Controllers",
        'frontControllerNamespace' => "App\\Http\\Controllers",
    ];
    

    i already inherited my controller what to do?

    CurrencyController updated in b1678f7c so you get these methods as trait but still you need to change config file