Datatables of laravel - datatables

I'm using Laravel recently and still have some difficulty using the APIs that it makes available.
I'm working on a project and I'm using infyom for the backoffice part and the php version is 7.1.
I started with the clone of the git repository (infyom adminLTE), then I configured my .env file, created the necessary migrations and sent the php artisan migrate command. So far all right!
Now I should use YAJRA to build datatables and their CRUD operations.
Following the instructions that make GitHub available, I can not get anything.
The steps I have followed are:
compiler require yajra / laravel-datatables-oracle: "~ 6.0" // here i tried also with version 8 (but nothing)
'providers' => [
...,
Yajra \ DataTables \ DataTablesServiceProvider :: class,
]
'aliases' => [
...,
'DataTables' => Yajra \ DataTables \ Facades \ DataTables :: class,
]
3.php artisan vendor: publish --provider = Yajra \ DataTables \
DataTablesServiceProvide
php artisan infyom: scaffold $ MODEL_NAME --fromTable --tableName = $ TABLE_NAME
Now my table appears in the left menu, but when I go to click it returns this type of error:
FatalThrowableError
Class 'Yajra \ DataTables \ DataTablesServiceProvider' not found
in ProviderRepository.php (line 208)
Can you tell me if I skipped a few passes?
Are the versions of these things good?

Related

Incorrect content of vendor/bin/codecept

I installed older Codeception 2.5 (because of module for PHP framework Yii1) like this:
composer require codeception/codeception:2.5.*
And then executed:
php vendor/bin/codecept run unit --coverage-html
And nothing happened. I can only see following code. I discovered that all 3 files (carbon, codecept, phpunit) in folder vendor/bin contain only this instead of PHP code:
#!/usr/bin/env sh
dir=$(cd "${0%[/\\]*}" > /dev/null; cd '../codeception/codeception' && pwd)
if [ -d /proc/cygdrive ]; then
case $(which php) in
$(readlink -n /proc/cygdrive)/*)
# We are in Cygwin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
;;
esac
fi
"${dir}/codecept" "$#"
Why is that? I am using Ubuntu 16 in Vagrant (CognacBox image). If I use XAMPP and Windows 10 it works correctly. I used Composer v1 and v2. Both with the same problem.

Correctly upload react native source maps to Bugsnag

I'm trying to setup Bugsnag on my react native 0.59.1, but I am not able to properly upload source maps.
The bugsnag-react-native plugin is properly installed and linked and I see errors in my bugsnag dashboard, the only problem is to properly use the source maps.
What I tried
In one of my javascript files, I added a simple fake error:
Bugsnag.notify(new Error('Error'))
The, following the official documentation I generated the bundle file and the source maps:
react-native bundle \
--dev false \
--platform android \
--entry-file index.js \
--bundle-output android-release.bundle \
--sourcemap-output android-sourcemaps.map
I uploaded them to bugsnag:
curl https://upload.bugsnag.com/react-native-source-map \
-F apiKey="XXXXX" \
-F appVersion="10.0.2" \
-F appVersionCode="100004" \
-F dev=false \
-F platform=android \
-F sourceMap=#android-sourcemaps.map \
-F bundle=#android-release.bundle \
-F projectRoot=`pwd`
In my bugsnag settings I can see the source maps with the proper versions:
But in the error report I get:
Note: I checked and the versions of the source maps are the same of the version in the event App tab.
I honestly don't know what to try anymore, do you have some ideas?
I'd advise you raise this directly with us at Bugsnag via the Support link on the dashboard so we can look at the details of the errors on your account and advise on why the source maps aren't being applied.
Looking at that screenshot though I suspect the issue may be that you're using RAM bundles in which case you'd need to use the react-native ram-bundle command in place of react-native bundle:
https://docs.bugsnag.com/platforms/react-native/react-native/showing-full-stacktraces/#generating-source-maps
Thanks!

Swagger codegen build fails

I've asked this question in the swagger github repository but the community doesn't look very responsive, so I'm going to try here.
Following the README I'm running this commands to generate a PHP client (but it could be any other language):
git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
mvn clean package
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate
\
-i http://petstore.swagger.io/v2/swagger.json \
-l php \
-o /var/tmp/php_api_client
and I get the following error:
Error: Unable to access jarfile modules/swagger-codegen-cli/target/swagger-codegen-cli.jar
Does anybody have the same error? I'm trying to figure out if it's just me. Maybe I'm missing something.
As of today (1/10/19) it only works with Java version 7 or 8. I had to downgrade from version 10 to make it work.

Sentry React-Native with CodePush not using source maps

I can't seem to figure this out. Can someone please help me troubleshoot this? I'm using CodePush to upload my app and I want Sentry to handle my errors since the appcenter diagnostics are not very good.
I have this in a root component of my app...
if (process.env.NODE_ENV === 'production') {
Sentry.config('****',{
deactivateStacktraceMerging: false
}).install();
codePush.getUpdateMetadata().then((update) => {
if (update) {
Sentry.setVersion(update.appVersion + '-codepush:' + update.label);
}
});
}
And I have a deploy package script that will deploy to codepush and also run the sentry commands found in their docs
appcenter codepush release-react -a account/project --output-dir ./build && export SENTRY_PROPERTIES=./ios/sentry.properties && sentry-cli react-native appcenter account/project ios ./build/codePush
Everytime I get an error caught or one that I've captured I lack actual information on what file threw the error and I see the There was 1 error encountered while processing this event at the top which says Source code was not found for app:///main.jsbundle when I expand it.
I feel that this has to be something with sentry not properly connecting to codepush to get my source maps?
Finally got the sourcemap to work for both iOS and Android with AppCenter codepush after some trial and failure (since the Sentry doc is misleading), following these steps in bash script:
MY_APP_NAME="e.g. Sentry account/project"
MY_BUNDLE_ID="e.g. com.company.superapp"
MY_APP_ENV="e.g. development, staging or production"
NATIVE_VERSION="e.g. 1.2.3"
PLATFORM="e.g. ios or android"
# Build and release to appcenter
appcenter codepush release-react \
-a "$MY_APP_NAME" \
-d "$MY_APP_ENV" \
-m -t "$NATIVE_VERSION" \
--sourcemap-output \
--output-dir "./build/$PLATFORM"
export SENTRY_PROPERTIES="./$PLATFORM/sentry.properties"
# Get label and name of latest release
LABEL=$(appcenter codepush deployment history $MY_APP_ENV -a $MY_APP_NAME --output json | jq '.[-1][0]' -r)
RELEASE_NAME="$MY_BUNDLE_ID#$NATIVE_VERSION+codepush:$LABEL"
# Upload sourcemap
sentry-cli react-native appcenter \
"$MY_APP_NAME" "$PLATFORM" "./build/$PLATFORM/CodePush" \
--deployment "$MY_APP_ENV" \
--release-name "$RELEASE_NAME" \
--dist "$LABEL"
And doing this initialization in app.ts (or similar):
Sentry.init({...});
codePush.getUpdateMetadata().then(update => {
if (update) {
if (MY_APP_ENV === 'production')) {
Sentry.setRelease(
`${MY_BUNDLE_ID}#${update.appVersion}+codepush:${update.label}`,
);
} else {
Sentry.setRelease(
`${MY_BUNDLE_ID}.${MY_APP_ENV}#${update.appVersion}+codepush:${update.label}`,
);
}
Sentry.setDist(update.label);
}
});
Environment:
appcenter version: 2.7.3
#sentry/react-native: 2.5.1
You need to call Sentry.init with release and dist options and pass the same values as flags when you upload your sourcemaps via the CLI.
As per the Sentry Docs
If you want to use Sentry together with CodePush you will have to pass release and dist to Sentry.init. Our suggestion is to store them in an app.json, or you can just use the package.json. These values need to be unique to each version of your codebase and match the version on the source maps exactly, or they might not be symbolicated.
For example:
Sentry.init({
dsn: YOUR_DSN,
release: '1.0',
dist: 'v1',
});
And then when you want to upload your source maps:
export SENTRY_PROPERTIES=./ios/sentry.properties
sentry-cli react-native appcenter \
account/project \
ios ./build/codePush \
--release-name "1.0" \
--dist "v1"
Your release and dist can be arbitrary strings, but Sentry recommends the following format:
${BUNDLE_ID}#${APP_VERSION}+codepush:${DIST}
I've had the same issue - everything gets uploaded to Sentry and attached into a Release, but Issues show this warning.
Issue for me was that bundle ID was different in the app and in Sentry Release, syncing this solved the issue.

Failure to deploy datasource because JBoss thinks it already exists

I am running gradlew deploy on a JBoss 7.0.5 application and it is complaining that one of my data sources already exists when I try deploying:
Deploying profile/deploy-datasources.cli
{
"outcome" => "failed",
"failure-description" => {"domain-failure-description" => "WFLYCTL0158: Operation handler failed: java.lang.IllegalStateException: WFLYCTL0363: Capability 'org.wildfly.data-source.MarketDataSource' is already registered in context 'profile=Int-Market'."},
"rolled-back" => true
}
I use the JBoss cli to deploy the data source (deploy-datasources.cli):
if (outcome == success) of ./subsystem=datasources/data-source=MarketDataSource:read-resource()
data-source remove --name=MarketDataSource --profile=#jboss.profile#
end-if
./subsystem=datasources/data-source=MarketDataSource:add( \
jta=false, \
jndi-name="java:/MarketDataSource", \
driver-name="oracle", \
connection-url="#leftthisout#", \
user-name="#leftthisout#", \
password="$\{#leftthisout#\}", \
min-pool-size=1, \
max-pool-size=5, \
validate-on-match=true, \
valid-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker", \
stale-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker", \
exception-sorter-class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter", \
idle-timeout-minutes=10, \
prepared-statements-cache-size=120, \
enabled=true \
)
if (outcome == success) of ./subsystem=datasources/data-source=MarketDataSource:read-resource
./subsystem=datasources/data-source=MarketDataSource/connection-properties=defaultRowPrefetch:add(value=100)
end-if
and use the JBoss cli again to undeploy data sources (undeploy-datasources.cli):
if (outcome == success) of ./subsystem=datasources/data-source=MarketDataSource:read-resource()
data-source remove --name=MarketDataSource --profile=#jboss.profile#
end-if
I do the same thing (except changing name, passwords, usernames etc.) for another data source and I have no issues with that. I have used a difference checker to ensure that. Something must be configured wrong with this datasource as opposed to the other but I can't figure out what it is.
Turns out there is a bug with JBoss 7.0.* explained here so I just undeployed the app and restarted my domain controller. Deploying again then worked.
Ugrading to JBoss 7.1.* would also work but I did not have that option at the moment so that was the work around.