Lina

Experience

1,780

0 Best Reply Awards

  • Member Since 5 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

21st September, 2017

Lina started a new conversation When A Mail Is Not Sent How To Not Block The Function? • 16 hours ago

Hi friends,

sometimes when I try to send a mail the functions "sendEmail" explodes because my server can't send the email in a concret momment, I don't want to change the server, what I want is to find a solution, if the server could not send the mail in an hipotetic case, how can I not block the function?

Thanks!

14th September, 2017

Lina started a new conversation [JS] Select2 Problems Setting Values By Default • 1 week ago

Hi friends,

I am trying to use the select2 lib (https://select2.org/data-sources/formats) to create an input to add tags associated with a Posts of the Blog, but when I charge the page the values of the tags are not appearing in the input like a introduced values.

https://gyazo.com/6359955a1ef17ce85c8d7409fb336298

        <div class="form-group">
        <label for="tags" class="control-label">Tags</label>
             <select id="tags" name="tags[]" class="form-control" multiple="multiple">
             </select>
        </div>
     
        $('#tags').select2({
    // What values should I do add to set values by default?
            multiple: true,
            results: {
                  "id": 3,
                  "text": "Option 3",
            },
            tokenSeparators: [','],
            ajax: {
                url: '{{ url("getTagsSelect2") }}',
                dataType: 'json',
                data: function(params) {
                    return {
                        term: params.term
                    }
                },
                processResults: function (data, page) {
                    return {
                        results: data
                    };
                },
            },
        });

I tired this but is not working:

        $('#tags').select2({
           multiple:true,
           ajax:{}}).select2({"data": 
        [{"id":"2127","text":"Henry Ford"},{"id":"2199","text":"Tom Phillips"}]});

Thanks for your help

12th September, 2017

Lina left a reply on Eloquent Relationships Question (whereHas) • 1 week ago

[Solved] Thanks to: https://laracasts.com/discuss/channels/eloquent/wherehas-relationship-getting-the-latest-row-but-want-to-do-a-where-on-this-result

public function getPostTags($tag_id = null)
{
    return \App\Post::whereHas('post_tags', function ($query) use ($tag_id){
        $query->where('post_tags.tag_id', '=', $tag_id);
    })->get();
}

Lina started a new conversation Eloquent Relationships Question (whereHas) • 1 week ago

Hi friends,

how can I pass a param to the where inside the function?

public function getPostTags($tag_id = null)
{
    return \App\Post::whereHas('post_tags', function ($query){
        $query->where('post_tags.tag_id', '=', $tag_id);
    })->get();
}

I have the table "Post" with a list of posts and the table"Post_tags" which relation the "posts" with "tags" (post_id, tag_id). Then I want to get the posts with a concret tag_id.

8th September, 2017

Lina left a reply on Execute Artisan Command From Code • 1 week ago

Finally works with Artisan::call('down');

Lina left a reply on Artisan Command Is Not Killed After Execution And Eats Memory • 1 week ago

I have a similar problem, I am doing a call with cronn jobs and my server present some problems for overload, could be for this?

Cron jobs statured 7% of CPU.

Lina started a new conversation Execute Artisan Command From Code • 1 week ago

Hi friends,

I want to execute an artisan command from a controller, how can I do that?

I tried this but doesn't work...

   use Artisan;
   ....

  public function putUnderMaintenance()
  {
     Artisan::call('down', []);
  }

Lina left a reply on Maintenance Mode (excluding Some Routes) • 1 week ago

How can you change the expluded ips?

hen can i put this array to access from anyside of my code like a global variable?

7th September, 2017

Lina left a reply on Cropit Problems With Image In Base64, How Can I Get The Image Edited? • 2 weeks ago

I am trying to work with cropit to edit images and stored the editions but... oops something is wrong...

Lina started a new conversation Cropit Problems With Image In Base64, How Can I Get The Image Edited? • 2 weeks ago

Hi friends,

how can I convert a base64 images to a file image to do that?

        $fileName = rand(11111, 99999).$request->post_img->getClientOriginalName();
        if(!$request->post_img->move('images/', $fileName))
        {
            throw new \Exception("Error with the image while processing the request", 500);
        }

When I try to do the "$request->post_img->getClientOriginalName();" always crash, the image is a base64 code, I tried this too but it give problems:

$data = explode(',', $request->post_img); $code = base64_decode($data[1]); $fileName = rand(11111, 99999).".jpeg"; file_put_contents('directory/'.$fileName, $code); $fileName = rand(11111, 99999).$request->post_img->getClientOriginalName(); if(!$request->post_img->move('images/', $fileName)) { throw new \Exception("Error with the image while processing the request", 500); }

Someone can explain me how images works? And how should I store it efficently?

Thanks for your help.

Lina left a reply on How To Use A NPM Package In Laravel? • 2 weeks ago

where is the gulpfile.js????

6th September, 2017

Lina left a reply on Catch Exceptions • 2 weeks ago

I am catching the tokenmismatchexception but I want to catch the exception that I said, how can i do?

public function render($request, Exception $exception)
{
    if($exception instanceof TokenMismatchException)
    {
        Alert::error('Seems you couldn\'t submit form for a long time. Please try again.', 'Oops!')->persistent("Close");;
        return redirect($request->fullUrl());
    }
    return parent::render($request, $exception);
}

Lina started a new conversation Catch Exceptions • 2 weeks ago

How can I catch a Laravel exception for example when you send a Post request and the "Post" is not in the route files to show an alert to the user while using ajax?

https://gyazo.com/5e2dc9559d5ea8a4eeb6a5756f722bbd

Thanks for your help

Lina started a new conversation How Create An Object With Eloquent And Return The Id? • 2 weeks ago

Hi friends,

how can we create a Post and return the id if we don't know it?

This works?

        $post = new Post;
        $post->post_title = $request->post_title;
        $post->post_img = $request->post_img;
        $post->post_description = $request->post_description;
        $post->post_content = $request->post_content;
        $post->post_visible = 1;
        $post->post_visited = 0;
        $post->created_at = \Carbon::now('Europe/Madrid');
        $post->updated_at = \Carbon::now('Europe/Madrid');
        $post->save();
        return json_encode($post->id);

Lina started a new conversation [QUESTION] Do You Know Packages To Upload An Edit Cover Images? • 2 weeks ago

Hi firends,

I am doing a personal blog, do you know some package/plugin to upload and edit in real time the cover images?

I am disposed to accept ideas to create the post cover image.

Thank you so much

3rd September, 2017

Lina started a new conversation Https With Laragon + Nginx • 2 weeks ago

Hi friends,

I have a problem setting the https url in my localhost. I am using Laragon with Nginx with ports 8080 and 8343.

SO: Windows 10 64bits.

Error capture: https://gyazo.com/57fd66f01ff77c332871b8f304a46d9a

Lina left a reply on POST Ajax Acting Like GET • 2 weeks ago

I found the error the meta tag token was not in the header of index file:

Now post is working nicely!

Lina left a reply on POST Ajax Acting Like GET • 2 weeks ago

going on not working:

Route::post('/setTagName', 'TagController@setTagName');

$(document).on('click', '#edit-button-test', function(e){
        var edit_id = this.getAttribute("data-id");
        var edit_name = this.getAttribute("value");
        var route = "{{ url('/changeTagName') }}";
        $.post({
            url: route,
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            data: {
                'id': edit_id,
                'tag_name': edit_name,
            },
            contentType: "application/json; charset=utf-8",
            dataType: 'json',
            success: function(data){
                console.log(data);
                swal("Nice!", "The new value is: " + data, "success");
            },
            error: function(data){
                console.log(data.responseJSON);
                msgError = "";
                if(data.responseJSON.message != "")
                {
                    $.each(data.responseJSON, function(key, value){
                        msgError = msgError+'<li>'+value+'</li>';
                    });
                }
                swal({
                    title: "Error 500",
                    text: msgError,
                    type: 'error',
                    confirmButtonText: false
                });
            }
        });
    });

Error:

C:\laragon\www\blog\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php#251 Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException

C:\laragon\www\blog\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php#251 Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException

2nd September, 2017

Lina left a reply on Ajax POST Request Response • 2 weeks ago

I found the error, now seems that is working like a GET instead of a POST.

Lina started a new conversation POST Ajax Acting Like GET • 2 weeks ago

C:\laragon\www\blog\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php#251

When I send a post request I get an error of a GET request: the route is not find, right because is a POST! but isn't working:

``$(document).on('click', '#edit-button', function(e){
        e.preventDefault();
        var edit_id = this.getAttribute("data-id");
        var edit_name = this.getAttribute("data-name");
        var route = "{{ url('/changeTagName') }}";
        swal({
            title: "Edit",
            text: "Write new value",
            type: "input",
            showCancelButton: true,
            closeOnConfirm: false,
            inputPlaceholder: edit_name,
            inputValue: edit_name
        }, function (inputValue) {
            if (inputValue === false) return false;
            if (inputValue === "")
            {
                swal.showInputError("You need to write something!");
                return false
            }
            // Change the value and return true/false
            $.ajax({
                type: "POST",
                url: route,
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                data: {
                    'id': edit_id,
                    'tag_name': inputValue,
                },
                contentType: "application/json; charset=utf-8",
                dataType: 'json',
                success: function(data){
                    console.log(data);
                    swal("Nice!", "The new value is: " + data, "success");
                },
                error: function(data){
                    console.log(data.responseJSON);
                    msgError = "";
                    if(data.responseJSON.message != "")
                    {
                        $.each(data.responseJSON, function(key, value){
                            msgError = msgError+'<li>'+value+'</li>';
                        });
                    }
                    swal({
                        title: "Error 500",
                        text: msgError,
                        type: 'error',
                        confirmButtonText: false
                    });
                }
            });
        });
    });´´

Lina started a new conversation Ajax POST Request Response • 2 weeks ago

Hi friends,

How can I get the value of a request with errors?

For example if the error is 500 how can I show this error in text with the object request?

IMG: https://gyazo.com/7164b2644b5240aa1dda1688977f2ef9

Lina started a new conversation DataTables With Laravel "show Rows" Repited Twice • 2 weeks ago

Hi friends,

I am trying to use datatables but this shit is happening:

https://gyazo.com/5d0a7065e95b8f6c119a1a5637d27e00 https://gyazo.com/66501e955689d54a691ede5417a5a1ed

Code: https://gyazo.com/1e43e8135c2d8263b38b501d0721521a

What can I do to solve this error?

1st September, 2017

Lina left a reply on The DB Is Not Working With Http, Can't Login • 2 weeks ago

Yes, I need use http sometimes to interact with http request to an api that has no https.

What can I do?

Lina started a new conversation The DB Is Not Working With Http, Can't Login • 2 weeks ago

Hi friends,

I can't login into my aplication when I use http instead of https, I have tried do another petitions to other urls and not work to access to DB methods. The error apears in my server what should I do?

Thanks for your dear help.

30th August, 2017

Lina started a new conversation Javascript Clone And Replace The Dom • 3 weeks ago

I am taking the html of the web useing clone method with jquery because I modify the element with a searcher that put content on the dom, however when I paste the old content there are a chart (sparkline) that lose the values. How can I fix that?

Before modify the dom: https://i.gyazo.com/4fc54c43362c5bd44b2e81c545f8f2db.png

Modifying the dom: https://gyazo.com/95a89dbd40966606bc2412a25755aa84

After replaceWith (The data of the sparkline desapeared): https://gyazo.com/aae5b0832a8737d4bfde0debddbb9476

Code:

`$(document).ready(function(){ var divClone; $('#search-post-open').click(function(e) { divClone = $("#main-page").clone(); }); $('#search-post-close').click(function(e) { $("#main-page").replaceWith(divClone); });

});`

28th August, 2017

Lina started a new conversation Convert The Response From JSON To HTML An Show With SeetAlerts • 3 weeks ago

HI friends,

I want to get a response from an ajax call and if is an error convert to html an show the error type with sweet alerts:

`error: function(data){

                var message = $.each(data.responseJSON, function(key, value){
                    return '<li>'+value+'</li>';
                });
                swal("Oops...", "Something went wrong!", message); // I don't know how to do that.
            }`

25th August, 2017

Lina left a reply on Problema Mostrando La Petición De Respuesta • 3 weeks ago

Parece y digo parece que es el tamaño de la pantalla porque en otros dispositivos funciona, de ser así tema zanjado... Menudo infierno.

Lina left a reply on Problema Mostrando La Petición De Respuesta • 3 weeks ago

Hola wowzone, gracias por tu respuesta, podrías ser más explicito por favor?

12th August, 2017

Lina started a new conversation Laravel Refresh URL From View • 1 month ago

How can I refresh a page with laravel from the view with a button, the url has get params and i want to preserve it.

It's like go to the same URL that current.

11th August, 2017

Lina left a reply on How To Change Timezone In App.php • 1 month ago

For me is not working right if I put Europe/Madrid, only works when I use date('Y-m-d H:i:s'); ...

5th August, 2017

Lina left a reply on Login Errors With Token • 1 month ago

up!

How can I solve this problem? To not show the users an error?

Thanks!

1st August, 2017

Lina started a new conversation POST Petition To Another Site With A Redirection • 1 month ago

Hi friends,

I want to make a post petition to another site and redirect the user, like a form with html, how can I do that with php/Laravel?

Thanks

Lina left a reply on Login Errors With Token • 1 month ago

And how can I refresh the web page when this happends?

26th July, 2017

Lina started a new conversation Login Errors With Token • 1 month ago

Hi friends,

sometimes when I try to do login laravel show me an error of mismatch token but the token is in the code, other times it works successfully. What is the reason?

How can I avoid this error?

24th July, 2017

Lina left a reply on Guzzle Get "problem" • 1 month ago

thanks

23rd July, 2017

Lina left a reply on Guzzle Get "problem" • 1 month ago

Solved, the problem was a mistake, the api has taken the database from the first code instead of his database, i am working in local may be because the values of $ENV file are the same.

Lina started a new conversation Guzzle Get "problem" • 1 month ago

Hi friends,

I am using the guzzle library to make GET and POST petitions to an API, the problem is that an URL is showing me a right request but when I make the GET request with guzzle then return me an error, why?

// Doing the request
class TradeController extends Controller
{
    public function showExpertAdvisor(EaApi $eaApi){
        $eaApiResponse = $eaApi->getCostumerAccount(Auth::user()->idUser);
    }
}
// Guzzle library
namespace App\Libraries;

use GuzzleHttp\Client;
use Config;

class EaApi{
    private $client;
    private $uri;

    public function __construct(Client $client)
    {
        $this->client = $client;
        $this->uri = Config::get('app.EA_SERVER_URL');
    }

    private function get($uri, $params = [], $returnDecoded = true)
    {
        try
        {
            $response = $this->client->get($this->uri . $uri, $params)->getBody()->getContents();
            if($returnDecoded) return json_decode($response, true);
            return json_decode($response, false);
        }
        catch(\Exception $exception)
        {
            return $this->returnError($exception);
        }
    }

    private function post($uri, $params = [], $returnDecoded = true)
    {
        try
        {
            $response = $this->client->post($this->uri . $uri, $params)->getBody()->getContents();
            if($returnDecoded) return json_decode($response, true);
            return json_decode($response, false);
        }
        catch(\Exception $exception)
        {
            return $this->returnError($exception);
        }
    }

    private function returnError(\Exception $exception)
    {
        if($exception instanceof ClientException)
        {
            $newException = json_decode($exception->getResponse()->getBody()->getContents(), true);
            if($newException)
            {
                $exception = new \Exception($newException[ 'reason' ], $newException[ 'code' ]);
            }
        }

        return [
            'error' => $exception->getMessage(),
            'code' => $exception->getCode()
        ];
    }

    public function getCostumerAccount($idUser){
        return $this->get('getCostumerAccount/'.$idUser, [
            'verify' => false,
        ], true);
    }
}

API receiving the request

// Routes


Route::get('/getCostumerAccount/{idUser?}', 'CostumerController@getCostumerAccount');

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Http\Response;
use App\Http\Requests\RequestCreateCostumer;
use App\Costumer_account;
use DB;

class CostumerController extends Controller
{

    public function getCostumerAccount($idUser = null)
    {
        try
        {
            return $this->getAccount($idUser);
        }
        catch(\Exception $exception) {
            return response()->json(['error' => 'You don\'t have an account vinculated yet']);
        }
    }

    private function getAccount($idUser)
    {
        try
        {
            return Costumer_account::where('idUser', $idUser)->first();
        }
        catch(\Exception $exception)
        {
            return response()->json(['error' => 'An error has occured when looking for the account']);
        }
    }
}

Lina left a reply on How To Clean Code • 1 month ago

    public function storeTradingAccount(Request $request, EaApiController $eaApiController){
        if( Auth::user()->idRole == Config::get('app.ROLE_ADMIN') || Auth::user()->idRole == Config::get('app.ROLE_TRADER_DIRECTOR') ){
            $this->validate($request, [
                'idAccount' => 'required',
                'nameAccount'=>'required'
            ]);
            $eaApiResponse = $eaApiController->storeTradingAccount($request->idAccount, $request->nameAccount);
            if(!isset($eaApiResponse['error'])) return redirect()->back()->with('success', trans('languages.added_account'));
            return redirect()->back()->withErrors($eaApiResponse['error']);
        }
        return redirect('404');
    }
  public function storeTradingAccount($idAccount, $nameAccount)
    {
        return $this->post('storeTradingAccount', [
            'form_params' => [
                'idAccount' => $idAccount,
                'nameAccount' => $nameAccount,
            ], 'verify' => false
        ], true);
    }

Lina left a reply on How To Clean Code • 1 month ago

Thank you so much, I am going to apply this changes :D

How can I learn more about programming better with laravel or programming in general?

Thanks for your help

22nd July, 2017

Lina left a reply on How To Clean Code • 1 month ago

Solved! with jsondecode

    public function storeTradingAccount($params = [])
    {
        return $this->post('storeTradingAccount', $params, true);
    }

    private function post($uri, $params = [], $returnDecoded = true)
    {
        try {
            $response = $this->client->post($this->uri . $uri, $params)->getBody()->getContents();
            if($returnDecoded) return json_decode($response, true);
            return json_decode($response, false);
        }
        catch(\Exception $exception) {
            return $this->returnError($exception);
        }
    }
    public function storeTradingAccount(Request $request, EaApiController $eaApiController){
        if( Auth::user()->idRole == Config::get('app.ROLE_ADMIN') || Auth::user()->idRole == Config::get('app.ROLE_TRADER_DIRECTOR') ){
            $this->validate($request, [
                'idAccount' => 'required',
                'nameAccount'=>'required'
            ]);
            $eaApiResponse = $eaApiController->storeTradingAccount(['form_params' => ['idAccount' => $request->idAccount, 'nameAccount' => $request->nameAccount], 'verify' => false]);
            dump($eaApiResponse);
            if(!isset($eaApiResponse['idAccount']) && !isset($eaApiResponse['nameAccount'])) return redirect()->back()->with('success', trans('languages.added_account'));
            return redirect()->back()->withErrors($eaApiResponse);
        }
        return redirect('404');
    }

Lina left a reply on Custom Request Response • 1 month ago

I found the solution:

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Response;

class RequestCreateTrader extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'idAccount' => 'required|unique:trading_accounts',
            'nameAccount' => 'required'
        ];
    }

    public function response(array $errors)
    {
          return Response::json($errors);
    }

}

Lina left a reply on Custom Request Response • 1 month ago

Thanks for your anwser, how do you think I can do a return of errors inside the RequestCreateTrader ?

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;
use Validator;
class RequestCreateTrader extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'idAccount' => 'required|unique:trading_accounts',
            'nameAccount' => 'required'
        ];
    }

    public function response(array $errors){ // Something like this to return the errors if something fail, this method is not working right, is an example
        return $errors;
    }
}

Lina started a new conversation Custom Request Response • 1 month ago

Hi,

I am doing a petition to an Api from another website, both done with laravel, my intention is to create an object in the second website and I want to make a custom response, to show if the response is right or not, how can do that?

I am doing the petition from the frist site doing this:

use GuzzleHttp\Client;
class EaApiController extends Controller {

    private $client;
    private $uri;

    public function __construct(Client $client)
    {
        $this->client = $client;
        $this->uri = Config::get('app.EA_SERVER_URL');
    }

    public function storeTradingAccount($params = []) // I call this method
    {
        return $this->post('storeTradingAccount', $params, false);
    }

    private function post($uri, $params = [], $returnDecoded = true)
    {
        try {
            $response = $this->client->post($this->uri . $uri, $params)->getBody()->getContents();
            if($returnDecoded) return json_decode($response, true);
            return json_decode($response, false);
        }
        catch(\Exception $exception) {
            return $this->returnError($exception);
        }
    }
}

This is my Request code to validate the request in second laravel:

    public function storeTradingAccount(RequestCreateTrader $request){
        try{
            Trading_account::create([
                'idAccount' => $request->idAccount,
                'nameAccount' => $request->nameAccount,
                'created_at' => date('Y-m-d H:i:s')
            ]);
            return 1;
        }
        catch(\Exception $exception) {
            return $exception;
        }
    }
class RequestCreateTrader extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'idAccount' => 'required|unique:trading_accounts',
            'nameAccount' => 'required'
        ];
    }

}

Lina left a reply on How To Clean Code • 1 month ago

I think it's improving, now just change the mega if :D

public function showAutotradePanel(EaApiController $eaApiController)
    {
        if(Auth::user()->idRole == Config::get('app.ROLE_ADMIN') || Auth::user()->idRole == Config::get('app.ROLE_TRADER_DIRECTOR'))
        {
            $eaApiResponse = $eaApiController->showTradingAccounts(['verify' => false]);
            if(!isset($eaApiResponse['error'])) return view('admin/trading/autotrade-panel')->with('eaApiResponse', $eaApiResponse);
            return view('admin/trading/autotrade-panel')->with('eaApiResponse', null)->withErrors($eaApiResponse['error']);
        }
        return redirect('404');
    }

Lina left a reply on How To Clean Code • 1 month ago

Thanks for your anwsers you are helping me a lot, I have a question for the Iostdreamer_nl anwser, where is the right place to create the file "API" in Laravel structure?

Another question about martinbean anwser, when I work with global variables where is a better place to put there? (ServiceProvider, env, Config->app, another, depends...)

What is the difference between:

return redirect()->back()->withSuccess(trans('languages.added_account'));

And

 return redirect(URL::previous())->with('success', trans('languages.added_account'));

Thanks for your time

21st July, 2017

Lina started a new conversation How To Clean Code • 2 months ago

Hi friends,

how can I optimize this code to make more clean?

This is an API that make a call from the function saveTradingAccount to storeTradingAccount in another laravel backend.

public function saveTradingAccount(Request $request){ if( Auth::user()->idRole == Config::get('app.ROLE_ADMIN') || Auth::user()->idRole == Config::get('app.ROLE_TRADER_DIRECTOR') ){ $this->validate($request, [ 'idAccount' => 'required|unique:trading_accounts', 'nameAccount'=>'required' ]); $client = new GuzzleHttp\Client(); $res = $client->request('POST', Config::get('app.EA_SERVER_URL').'storeTradingAccount', [ 'verify' => false, 'form_params' => [ 'idAccount' => $request->idAccount, 'nameAccount' => $request->nameAccount, ] ]); if($res->getStatusCode() == 200){ if($res->getBody()) return redirect(URL::previous())->with('success', trans('languages.added_account')); } return redirect(URL::previous())->with('error', trans('languages.internal_error')); } return redirect('404'); }

public function storeTradingAccount(Request $request){ $validator = Validator::make($request->all(), [ 'idAccount' => 'required', 'nameAccount' => 'required' ]); if(!$validator->fails()) { $accountCreation = Trading_account::create([ 'idAccount' => $request->idAccount, 'nameAccount' => $request->nameAccount, 'created_at' => date('Y-m-d H:i:s') ]); if($accountCreation) return true; } return false; }

16th July, 2017

Lina left a reply on Syntax Error • 2 months ago

Thanks, I found the error, a parentesis

--> ->where('users.idRole', '=', Config::get('app.ROLE_FREE') 
--> ->where('users.idRole', '=', Config::get('app.ROLE_FREE')) ```


15th July, 2017

Lina started a new conversation Syntax Error • 2 months ago

syntax error, unexpected ';'

What !!!

DB::table('users') ->where('users.idRole', '=', Config::get('app.ROLE_FREE') ->orwhere(function ($query) { $query->where('users.idRole', '=', Config::get('app.ROLE_USER')) ->whereExists(function ($query) { $query->select(DB::raw('users_packs.idUser')) ->from('users_packs') ->where('users_packs.finished_at', '>=', date('Y-m-d H:i:s')) ->whereRaw('users_packs.idUser = users.idUser'); }); }) ->get(); // The error mark here

30th June, 2017

Lina left a reply on Send And Receive Mails With Godaddy And Laravel 5.4 • 2 months ago

FInally i can send emails to mailgun, now the email is not validated then for this reason are not arriving:

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.