jeudi 1 juin 2017

How to check the MySQL JSON column is not contains the value in laravel?

I used to find whether the searching item is exist in the JSON datatype column or not.

I use,

 TABLE::whereRaw('json_contains(list, \'["value"]\')')->get();

this to return those are having the "value" in "list" JSON column.

But, how can i use reverse method to list, those are not having this value in json column in laravel.

Thank you !



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2rXprZ9
via IFTTT

Code different locally and on browser

I am using laravel with EC2 amazon webserver running on ubuntu, and the problem is when I run the website on a browser the code is different. As an example please see images below.

I have tried to clear views, clear-compiled, clear cache, disable cache in browser as well as delete DNS setting in google chrome however I still have the same problem.

Code on "local file"

Code on browser enter image description here

On localhost, if I update the file, code updates straight away but on the server it doesn't. Someone can help?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qJ3OH6
via IFTTT

Laravel 5.4 Use If/Else inside of a controller

I'm trying to use @if & @else inside a controller, eg:

public function deleteCharacter ($char_delete_id)

    {

@if (Auth::user()->id == $delCharacterUserID) 
$deleteSuccess = 1;

            return redirect('/characters')->with('deleteSuccess', $deleteSuccess); 


@else 
      $deleteSuccess = 0;

        return redirect('/characters')->with('deleteSuccess', $deleteSuccess); 

    @endif

This throws the error:

FatalErrorException in CharacterController.php line 40: syntax error, unexpected 'if' (T_IF)



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2rdUH4U
via IFTTT

Laravel changed configured database name

I have two laravel api projects,

1-used for mysql database and another used for mssql database

I called mysql project api service to get orders and some data related with order are exists in mssql and I have written a call of curl in 1st project to get from another information related with order from mssql project api (mssql service api url = localhost/laravelmssql/api/getorderInfo/OrderID)

mssql service call working fine from browser

but when I call it from 1st project with curl its getting wrong database which is configured in 1st project

Note: This is adding correct database connection info in $_SERVER when I call it from browser

[DB_PORT] => 1433
[DB_DATABASE] => MSSQL DATABASE
[DB_USERNAME] => MSSQL_USERNAME
[DB_PASSWORD] => MSSQL_PASSWORD

but when I call it from curl the $_SERVER don't have these above variables



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2rWW6xT
via IFTTT

Laravel getStream - How to follow or add activity to a Company (non user)

an app I am creating needs to follow Companies, aside from users. And let the companies have their own activities. How is this configured in Laravel getStream. Seems the feeds are only for user types.

timelineFeed = FeedManager::getNewsFeed($user->id)['timeline'];
$aggregatedTimelineFeed = FeedManager::getNewsFeed($user->id)['timeline_aggregated'];

Thanks in advance guys.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qDRVTP
via IFTTT

Blur parts of a MS document on web application

am developing a web application with some subscription model. A user is presented with a preview of the content,while censoring the rest of the content. The censored/ blurred content will be accessible on login. How can I do this in PHP- laravel framework. Attached is a sample of the final page I would like to present to usersenter image description here



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qJbtFC
via IFTTT

The only supported ciphers - Laravel hosting on Fortrabbit

This question is all over stackoverflow but I just had to post it again. Mine is actually on Fortrabbit, I've been having this error on Fortrabbit for a Laravel 5.4 App, even after I've generated the key with php artisan key:generate and in my config/app.php I have "cypher" : "AES-256-CBC".

Almost tried all it takes to fix this error, but still getting it at the end.

The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

Is this a Fortrabbit thing? I don't know if anyone else has encoountered this on Fortrabbit Any help is appreciated.

I've done php artisan config:cache, composer install still the same.

Thanks



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2sgTSqE
via IFTTT