Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to encode/encrypt Laravel blade file by ioncube

I am trying to encode my Laravel project but unfortunately, Laravel blade templates are not pure PHP .. so the ioncube encoder/reader is unable to encode it properly.

I have tried these ways mentioned here and here, but my views files are not encoded fully ..or not working the way I want (or I have not understood it properly).

so can anyone please help me and tell me to step by step and clear.

These are some of my files inside the blade.php files which are not encodable.

@php
    // alignment direction according to language
    $dir = "ltr";
    $rtlLang = ['ar'];
    if(in_array(getOption('language'),$rtlLang)):
        $dir="rtl";
    endif;

@endphp


{!! getOption('home_page_meta') !!}
  <title>@yield('title')</title>

  @endif

    {{ csrf_field() }}


    {{ getOption('currency_symbol') . number_format(Auth::user()->funds,2, getOption('currency_separator'), '') }}
like image 928
ppegu Avatar asked Dec 07 '25 10:12

ppegu


1 Answers

Finally I got an idea and its worked (no one suggested)

you can easily encode your blade by its original code like an example : {{ getOption() }} to <?php echo e(getOption()); ?> . and @if as <php if; ?>

and @section('title', getOption('app_name') . ' - Login') as <?php $__env->startSection('title', getOption('app_name') . ' - login'); ?> and like so. And now you can encoded any blade templates files or laravel projects.

Hope this helpful. Now i have saved my templates file from thief.

like image 120
ppegu Avatar answered Dec 09 '25 23:12

ppegu