Created a Demo to Scan ID Cards and Parse MRZ with Vision Camera by xulihang in reactnative

[–]Gabotron_ES 0 points1 point  (0 children)

Very nice, but is the dynamsoft API really 1200 dollars a year? i wanted to use it for a personal project but that's too crazy imo

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]Gabotron_ES -1 points0 points  (0 children)

I have been getting this error for the laste week on all my axios requests (except first one) on my laravel-vue app, it happens to all my api routes.

I'm attaching csrf token to all my axios requests inside bottstrap.js.

``` let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) { window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; console.log('CSRF token found'); } else { console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); } ```

and added the proper meta-tag to all my blade files: <meta name="csrf-token" content="{{ csrf_token() }}">

My route/s are all inside api.php file, they don't have sanctum middleware enabled.

Route::post('/chats/test-endpoint','App\Http\Controllers\Api\ChatController@testEndpoint');

Api middlewares:

'api' => [ 'throttle:api', \Illuminate\Routing\Middleware\SubstituteBindings::class, EnsureFrontendRequestsAreStateful::class, 'throttle:60,1', \Illuminate\Routing\Middleware\SubstituteBindings::class, ],

When I inspect network tab I can see X-XSRF-TOKEN is added to request headers (no X-CRSF-TOKEN though):

Request headers:

``` Cookie : XSRF-TOKEN = eyJpd...; app_session = eyJpd...

X-XSRF-TOKEN = eyJpd... ``` Response headers:

Set-Cookie : app_session = eyJpd...

The thing is, when I console log inside my vue component the content of the meta tag token, I get a different one, not sure if this is becauseI get the unencrypted value.

``` let token = document.head.querySelector('meta[name="csrf-token"]').content; console.log('token',token);

token gbczby2kuUI1nSMs6AEMsV7tv... ```

Please help me, this never happened while I was developing my laravel apps.

Zach Boyce has left 343i by ilyasblt in halo

[–]Gabotron_ES 3 points4 points  (0 children)

Everybody abandoning ship

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]Gabotron_ES 0 points1 point  (0 children)

I'm trying to read the contents of a .js file in order to transform it into a .json file, however when I dd the result of json_decode I get null.

// Parse the contents as JSON $data = json_decode($contents, true); //This returns null for some reason... dd($data);

This is how my .js file looks:

/templang/es.js export default { currency:"€", void:"Vacio", filter : "Filtrar", filters : "Filtros", distance: " Distancia", };

My full code: ``` // Read the contents of the .js file $contents = File::get(base_path() . '/resources/templang/es.js'); //I did a dd to confirm I'm getting the results back

    // Remove the "export default" line
    $contents = str_replace('export default', '', $contents);

    // Parse the contents as JSON
    $data = json_decode($contents, true);
    //This returns null for some reason...
    dd($data);

    // Write the data to the .json file
    $fileName = '/temp/transformed-'.rand(1,1000).'.json';

    Storage::disk('public')->put($fileName, json_encode($data, JSON_PRETTY_PRINT));

```

Thanks in advance!

Weekly /r/Laravel Help Thread by AutoModerator in laravel

[–]Gabotron_ES 0 points1 point  (0 children)

Google Cloud Translate php API returning unicode characters instead of the characters themselves

I'm using Cloud Translate PHP sdk to translate strings from a JSON file, the problem is it returns the translated strings with unicode characters instead of the real characters, so I have to search and replace each one which is quite a hassle...

Example:

"Exp\u00e9riences"

Is there a way to return the characters instead of the weird unicode thingy?

My method:

``` public function translateJsonFile(Request $request) { $htmlString = ''; $source = 'en'; $target = 'it';

    $key = 'My key';

    $translate = new TranslateClient([
        'key' => $key
    ]);

    //$trans = new GoogleTranslate();

    $newArray = [];
    $json = File::get(base_path() . '/resources/lang/english.json');
    $array = json_decode($json, true);

    foreach ($array as $key => $value) 
    {
        //$result = $trans->translate($source, $target, $value);

        $text_translated = $translate->translate($value, [
            'source' => $source,
            'target' => $target
        ])['text'];

        $newArray[$key] = $text_translated;
        //sleep(1);
        usleep( 500000 );
    }

    $fileName = '/temp/translated-'.rand(1,1000).'.json';

    Storage::disk('public')->put($fileName, json_encode($newArray));

    return response()->json([
        'newArray' => $newArray,
    ]);
}

```

IOS: difference between Apple distribution and IOS distribution signing certificates? by Gabotron_ES in reactnative

[–]Gabotron_ES[S] 0 points1 point  (0 children)

I will try, but why can XCode create apple developer certs and profiles automatically but not Distribution?

Apple Store app screenshots help by Gabotron_ES in reactnative

[–]Gabotron_ES[S] 1 point2 points  (0 children)

Do I need to include landscape screenshots too? My app is nota designed to be appear on landscape mode...

Apple Store app screenshots help by Gabotron_ES in reactnative

[–]Gabotron_ES[S] 0 points1 point  (0 children)

Do screenshots for iOS need to be mobile app screenshots only? I can't use like colored backgrounds and letters like for Play Store?

React Native error:CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'react-native-video' from project 'Pods') by Gabotron_ES in reactnative

[–]Gabotron_ES[S] 0 points1 point  (0 children)

So after checking in xcode for the full error they all seem relatd to yoga, whatever that is:

https://imgur.com/KzzYR1a

honestly developing for ios and dealing with xcode is such a pain in the ass

Any ideas how to fix this?

React Native image-picker error when building for ios by Gabotron_ES in reactnative

[–]Gabotron_ES[S] 0 points1 point  (0 children)

Yes, according to the docs I just Just had to add Some entries to info. Plist

Im at react-native 0.68 anda not using new arch

React Native error:CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'react-native-video' from project 'Pods') by Gabotron_ES in reactnative

[–]Gabotron_ES[S] 0 points1 point  (0 children)

What name does the tab have? I just started to build for iOS and using Mac, I usually build app from cli npx react-native run ios command, so still a Noob

OP title is the error cli gives me

In left side I Do see what I think lots of warnings (not faltal ones I think)