davidsi02

Fullstack Web Developer at Servidor Informática

Member Since 6 Months Ago

Coimbra

Experience Points
2,490
Total
Experience

2,510 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
8
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 1
2,490 XP
Mar
04
4 days ago
Activity icon

Replied to SQLSTATE[42S22]: Column Not Found

auth()->id() value is 1 and these are correspondent to the unique user in DB and also corresponds to the foreign table 'userid' value.

Mar
02
6 days ago
Activity icon

Replied to SQLSTATE[42S22]: Column Not Found

Yes, I have. It just shows the data from the tests table and not from the testsresuts (timestamp, result and approved fields)and I have both tables filled

Activity icon

Replied to SQLSTATE[42S22]: Column Not Found

I've tryied you're code and isn't returning any error but it doesn't collect the data from testreslts table.

Activity icon

Replied to SQLSTATE[42S22]: Column Not Found

Thank you for you're help.

I've aplied you're sugestion and it returns me the following error:

Call to undefined method App\Test::testresults()

Activity icon

Started a new Conversation SQLSTATE[42S22]: Column Not Found


Controller: 
 $testscompleted = Test::with('testresults')->where('userid', Auth::user()->id)->get();

Models:

class Test extends Model
{
    public function tests()
    {
        return $this->hasMany(TestResult::class, 'testid');
    }
}

class TestResult extends Model
{
    const CREATED_AT = 'creation_date';
    protected $table = 'testresults';

}

Migrations:

class CreateTestresultsTable extends Migration
{
    public function up()
    {
        Schema::create('testresults', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('userid')->unsigned();
            $table->bigInteger('testid')->unsigned();
            $table->integer('result');
            $table->boolean('approved');

            $table->foreign('userid')->references('id')->on('users');
            $table->foreign('testid')->references('id')->on('tests');

        });
    }
}


class CreateTestsTable extends Migration
{
    public function up()
    {
        Schema::create('tests', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->bigInteger('themeid')->unsigned();
            $table->string('img');

            $table->foreign('themeid')->references('id')->on('themes');
        });
    }
}


Anyone can help me to fix this?

Feb
24
1 week ago
Activity icon

Started a new Conversation Error: Undefined Variable

Can anyone help me to solve this error?

View:

    @foreach($themes as $theme)
        <div>
            @foreach($tests as $test)
                @if($test->themeid == $theme_id)
             <!--- Test Image + Title in row -->

                @endif

              <!---  Button to advance in row --->

            @endforeach



        </div>
    @endforeach

Controller:

  public function IndexHelper()
    {
        return view('dashboard', compact([
            'themes' => Theme::all(),
            'tests' => Test::all()
        ]));
    }

Route:

Route::get('/home', '[email protected]')->name('home');


Error:
Undefined variable: themes (View: C:\xampp\htdocs\itstep\links\resources\views\dashboard.blade.php)
Feb
16
2 weeks ago
Activity icon

Started a new Conversation How To Update A Model Without 'updated_at' Field.

How to update a model without 'updated_at' field. For this DB table I don't need that row so how can I disable it when using the method update?

On controller:
  Answer::where('id', $values['id'])->update($values);

Model:

class Answer extends Model
{
    public function disabletimestamp()
    {
        $this->timestamps = false;
        return $this;
    }
}
Feb
11
3 weeks ago
Activity icon

Replied to Can't Change Checkbox Value.

How to aply the output to the checkbox value?

Feb
10
3 weeks ago
Activity icon

Started a new Conversation Can't Change Checkbox Value.

I'm trying to change the value of a checkbox when it checked/unchecked propertie is changed.

HTML:

<input name="correct" id="correct" type="checkbox" value ="0" onclick = 'checkboxHelper("correct");' unchecked>

´´´

JS:     

if(checkbox.checked == 1){
        document.getElementById(checkbox).val = 1;
    } else {
        document.getElementById(checkbox).val = 0;
    }


Does anyone knows how I can make this work?
Feb
09
3 weeks ago
Activity icon

Replied to [ERROR] Array To String Conversion

As I've told you in another post I have less than an year of experience on real-life coding so I still have a lot to learn but I have a project to do all alone I need to get it done until the deadline so for now I don't have a lot of time to dig more into the laravel concepts but I know that I'm still very poor on them but the company I'm working now don't cares about that, they just want me to get it working so I'm trying to do my best with the resources and time I've while trying to learn more in the process. Don't get me wrong, I know that I need to study the framework and it's components but right now I can't conciliate the learning and the development. :)

Activity icon

Started a new Conversation [ERROR] Array To String Conversion

My code:

public function gestAnswers(){
     $values = \request()->all();

     if (isset($values['_token'])) unset ($values['_token']);
     if ($values['id'] == 0) unset ($values['id']);

       if($values['correct'] == true) $correct = 1; else $correct = 0;
       unset($values['correct']);
        
               if (!isset($values['id'])) {
               \DB::table('answers')->insert([[$values] , ['correct', $correct]]);
              } else {
                \DB::table('answers')->where('id', $values['id'])->insert([[$values] , ['correct', $correct]]);
                    }

      return redirect('/admin/test/editquestions/'.$values['questionid']);   


}

Does anyone can explain me why laravel it's returning that error?

Feb
04
1 month ago
Activity icon

Replied to Undefined Index: Questionid

I'm not a front-end developer, but since I were assigned a project that I have no much time to get done and all alone I have to do it has I can.. Still I just have something like half-an-year of experience so it's complicated to me to develop something that I weren't trained for, but I'm still trying to do my best and learning on the go. :)

Activity icon

Replied to Undefined Index: Questionid

Tried that also. Same error

Activity icon

Replied to Undefined Index: Questionid

It gives me the same error:

public function gestAnswers(){
         $values = \request()->all();

         echo $values['questionid'];
}



Undefined index: questionid
Activity icon

Replied to Undefined Index: Questionid

How can I use that to get all the values of the form in once?

Activity icon

Started a new Conversation Undefined Index: Questionid

I'm trying to get values from a HTML form and it keeps giving me undefined index.

HTML:

<form method="POST" action="/admin/answer/gest/">

                            <div class="form-group bmd-form-group">
                                <div class="input-group">
                                    <div class="input-group-prepend">
                                        <div class="input-group-text"><i class="material-icons"></i></div>
                                    </div>
                                    <input name='id' type="text" class="form-control" placeholder="" id='AnwserId'
                                           value='0' hidden>
                                </div>
                            </div>

                            <div class="form-group bmd-form-group">
                                <div class="input-group">
                                    <div class="input-group-prepend">
                                        <div class="input-group-text"><i class="material-icons"></i></div>
                                    </div>
                                    <input name='questionid' type ="int" class="form-control" placeholder="" id='QuestionId'
                                           value="0" hidden>
                                </div>
                            </div>

                            <div class="form-group bmd-form-group">
                                <div class="input-group">
                                    <div class="input-group-prepend">
                                        <div class="input-group-text">Answer Text:</div>
                                    </div>
                                    <input name='text' type="text" class="form-control" placeholder="" id='AnswerText' required>
                                    <input name="correct" type="hidden" value="false" />
                                    <input name="correct" id="correct" type="checkbox" value="true" />
                                    <label for="scales">Correct</label>
                                </div>
                            </div>


                            <!--- Botão Salvar --->

                            <div class="input-group">
                                <div class="input-group-prepend">

                                </div>
                            </div>
                            <br> <br> <br><br>
                            <div class="modal-footer justify-content-center">
                                <button type="submit" class="btn btn-primary btn-link btn-wd btn-lg">
                                    Submit
                                </button>
                            </div>

                            <!--- Fim do Form --->

                        </form>


PHP: 

public function gestAnswers(){
         $values = $_POST;

         echo $values['questionid'];
}
´´´

Error:
Undefined index: questionid
Feb
02
1 month ago
Activity icon

Started a new Conversation AJAX Script Not Working.

I'm trying to retrive data from my DB using AJAX and PHP to display it on the screen but the JS variables keep undefined.

JS:

var getQuestionData = (id) => {
showModal('questionedit');

    $.ajax({
        type: 'GET',
        url: '/admin/question/getdata/' + id,
        data: {'_token': $("input[name='_token']").val()},
        success: function (data) {

            console.log(data.id);
            console.log(data.testid);
            console.log(data.text);

            $('#Altid').attr('placeholder', data.id).val(data.id);
            $('#Alttestid').attr('placeholder', data.testid).val(data.testid);
            $("#Altname").attr('placeholder', data.text).val(data.text);


        }
    });
    }


PHP:

      public function getQuestionData($id){
        $data = \DB::table('questions')->where('id', $id)->get();

        return response()->json($data);    

    }


What PHP returns:

[{"id":5,"text":"Eu n\u00e3o sei","testid":1}]

Console:
undefined
undefined
undefined


Someone knows what I'm doing wrong?
Jan
29
1 month ago
Activity icon

Replied to Allways Updating In DB When It Should Insert

Thank you. I've already figured the error, Ive made a mistake in the inputs ids so it were passing 1 to the if.. Now it's fixed

Activity icon

Started a new Conversation Allways Updating In DB When It Should Insert

Hey.

My app is always updating DB rows even when it should insert.

Code:

    public function gestQuestions(){
        $values = $_POST;

        if (isset($values['_token'])) unset ($values['_token']);
        if ($values['id'] == 0 || $values['id'] < 1 || !isset($values['id'])) unset($values['id']);


                  if (!isset($values['id'])) {
                        \DB::table('questions')->insert($values);
                 } else {
                         \DB::table('questions')->where('id', $values['id'])->update($values);
                       }

         return redirect('/admin/test/editquestions/'.$values['idtest']);       

}
´´´´´ 

I've checked and in the POST method the value of $values['id] is 0, so, it should insert and not update.
Jan
26
1 month ago
Activity icon

Started a new Conversation Button Not Working.

When I click the button nothing happens.

Code:

<button name="editquestions" id="editquestions" class="btn btn-success" href="/admin/test/editquestions/{{$test->id}}"> Questions </button>
´´´
Activity icon

Started a new Conversation Model Not Being Found.

When I try to use my model it gives me the follwowing error:

Class 'App\Http\Controllers\App\Question' not found

Model Code:


namespace App;

use Illuminate\Database\Eloquent\Model;

class Question extends Model
{
        /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'questions';

    protected $primaryKey = 'id';
    public $timestamps = false;



}

Controller code:

$questions = App\Question::with('answers')->where('testid', $id)->get();

´´´
Jan
25
1 month ago
Activity icon

Replied to Undefined Variable

Thank you for you're help but I'm not into de models yet, I still can't use them unfortunatly. :(

Activity icon

Replied to Undefined Variable

Thank you for you're help but I'm not into de models yet, I still can't use them unfortunatly. :(

Activity icon

Replied to Undefined Variable

Thanks for you're help. Now it's returning the following error: Undefined offset: 1

Activity icon

Started a new Conversation Undefined Variable

Hey, I'm having the error compact(): Undefined variable: answers when runnig the code below and I don't understand why, someone can help me?

Code:

  public function getQuestions($id){
       
    $questions = \DB::table('questions')->where('testid', $id)->get();

       foreach($questions as $question){
         $answers[$question->id] = \DB::table('answers')->where('questionid', $question->id); 
       }

       return view('admin.tests.testquestions',compact(['questions','answers']));


  }
Jan
11
1 month ago
Activity icon

Started a new Conversation Target Class [Illuminate\Auth\Middleware\adminpermission] Does Not Exist.

I'm trying to create a midleware to filter requests where the user hasn't the admin permission and redirect them back.

Midleware code:

class adminpermission extends Middleware
{
    public function handle($request, Closure $next)
    {

      if(Auth::user()->usertype >= 1){
        return $next($request);

      } else {

          return redirect()->back();

      }
    }
}



Routes:

Route::group(['middleware' => 'adminpermission'], function () {

  Route::any('/admin/themes', function(){
      return view('admin.themes.themesmngm');
  });

  Route::any('/admin/themes', '[email protected]')->name('getthemes');
  Route::any('/admin/themestats/{id}', '[email protected]');
  Route::any('/admin/theme/delete/{id}', '[email protected]');
  Route::any('/admin/theme/getdata/{id}', '[email protected]');
  Route::any('/admin/theme/edit', '[email protected]')->name('gesttheme');

  Route::any('/admin/tests', function(){
      return view('admin.tests.index');
  });

  Route::any('/admin/tests', '[email protected]')->name('getthemes');
  Route::any('/admin/teststats/{id}', '[email protected]');
  Route::any('/admin/tests/delete/{id}', '[email protected]');
  Route::any('/admin/tests/getdata/{id}', '[email protected]');
  Route::any('/admin/tests/edit', '[email protected]')->name('gesttest');

});´´´´

Kernel:

    protected $routeMiddleware = [
        'auth' => \App\Http\Middleware\Authenticate::class,
        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
        'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
        'can' => \Illuminate\Auth\Middleware\Authorize::class,
        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
        'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
        'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
        'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
        'adminpermission' => \Illuminate\Auth\Middleware\adminpermission::class,
    ];
Jan
04
2 months ago
Activity icon

Replied to How To Send Multiple Variables On A Return Statement.

Do you know a way I can call both getThemes() and getData($themeId) in the view to form the table where I want that the that is displayed?

At the moment I have this code:

      <table class="table align-items-center table-dark table-flush" action = "{{'[email protected]'}}">
        <thead class="thead-dark">
          <tr>
            <th scope="col" class="sort" data-sort="name">Theme</th>
            <th scope="col" class="sort" data-sort="budget">Certificates</th>
            <th scope="col" class="sort" data-sort="status">Tests Completed</th>
            <th scope="col">Users</th>
            <th scope="col" class="sort" data-sort="completion">Completion</th>
            <th scope="col"></th>
          </tr>
        </thead>
        <tbody class="list">

          @foreach ($themes as $theme)

          <tr onload="getThemeData({{$theme->id}})">
            <td> <img alt="Image placeholder" src="{{$theme->themeimg}}" width="30" height="30"> {{$theme->name}} </td>
            <td> <a name='nCertificates' type="text" placeholder="" id='nCertificates'> </td>
          </tr>

          @endforeach

        </tbody>
      </table>
Dec
29
2 months ago
Activity icon

Started a new Conversation How To Send Multiple Variables On A Return Statement.

Hello. I'm creating a certification online platform and I'm grouping the tests per categories/themes. So I want to show the following data in the view.

(Theme logo from themes table). (Theme name from themes table). (Quatity of certificates avaible in that theme from tests table where FK idtheme matches id on theme table). (Tests completed from the testresults table where idtest matches FK id on tests table where idtheme must match id on theme table). (Tests approved from the testresults table where approved = true && idtest matches FK id on tests table where idtheme must match id on theme table). (Approved rate that's numbertestsapproved /numbertestscompleted * 100.)

I've tried to do that with PHP and AJAX but it doesn't work as I wish since the PHP before de AJAX. There is my code:

public function getThemes()
{
   $themes = \DB::table('themes')->get();

   return view('admin.themes.themesmngm', ['themes' => $themes]);
}

public function getNumberOfTests($themeid){

   $tests = \DB::table('tests')->where('themeid', '=', $themeid);
   $numberoftests = $tests->count();

   return response()->json($numberoftests, 200);
}

public function getCompletedTests($themeid){

       $testscompleted = \DB::table('testresults')->
       join('tests', 'testresults.testid', '=' , 'tests.id')->where('tests.themeid','=', $themeid)->get();

      $numcompletedtests = $testscompleted->count();

      return response()->json($numcompletedtests, 200);


}

public function getApprovedTests($themeid){

    $testsapproved =  \DB::table('testresults')
    ->join('tests', function ($join) use ($themeid) {
        $join->on('tests.id', '=', 'testresults.id')
             ->where('tests.themeid', '=', $themeid);
    })->where('approved', '=', 1)->get();

   $numtestsapproved = $testsapproved->count();


}

public function getApprovedPercentage($themeid){

  $testscompleted = \DB::table('testresults')->
  join('tests', 'testresults.testid', '=' , 'tests.id')->where('tests.themeid','=', $themeid)->get();

  $testsapproved =  \DB::table('testresults')
  ->join('tests', function ($join) use ($themeid) {
      $join->on('tests.id', '=', 'testresults.id')
           ->where('tests.themeid', '=', $themeid);
  })->where('approved', '=', 1)->get();


           $ratio = $testscompleted->count() / $testsapproved->count();

           $percentage = $ratio * 100;

}

´´´´

Is it possible to make all that code into just one controller function and return all the variables I need to show in the blade? How?

Dec
17
2 months ago
Activity icon

Started a new Conversation Undefined Variable In A JOIN Clause.

I'm trying to retrieve data from my DB using a JOIN and a WHERE caluse.

Here's my code:

public function getApprovedTests($themeid){

    $testsapproved =  \DB::table('testresults')
    ->join('tests', function ($join) {
        $join->on('tests.id', '=', 'testresults.id')
             ->where('tests.themeid', '=', $themeid);
    })->get();

   $numtestsapproved = $testsapproved->count();

        echo $numtestsapproved;

}

(The $themeid value is being sent throught GET method).

It retrieves me the error: Undefined variable: themeid

How can I solve this?

(Sorry for not formating the code but I don't really remember how to do that).

Activity icon

Started a new Conversation Integrity Constraint Violation: 1052 Column 'id' In On Clause Is Ambiguous (SQL: Select * From `testresults` Inner Join `tests` On `id` = `testid`)

I have 2 DB tables I want to JOIN with the following code: $testscompleted = \DB::table('testresults')-> join('tests', 'id', '=' , 'testid')->get();

The following error is retrived: Integrity constraint violation: 1052 Column 'id' in on clause is ambiguous (SQL: select * from testresults inner join tests on id = testid)

Here are the migations from the tables:

public function up() { Schema::create('testresults', function (Blueprint $table) { $table->id(); $table->timestamps(); $table->bigInteger('userid')->unsigned(); $table->bigInteger('testid')->unsigned(); $table->integer('result'); $table->boolean('approved'); $table->foreign('userid')->references('id')->on('users'); $table->foreign('testid')->references('id')->on('tests'); }); }

public function up() { Schema::create('tests', function (Blueprint $table) { $table->id(); $table->string('name'); $table->bigInteger('themeid')->unsigned(); $table->string('img'); $table->foreign('themeid')->references('id')->on('themes'); }); }

How I can solve this problem without changing the index names?

(Sorry for not formating the code but I really don't remember how to do that).

Dec
11
2 months ago
Activity icon

Replied to Php Artisan Preset Don't Work Installing A Template.

When I do php artisan ui argon it retrieves the following error:


 Invalid preset.

 at C:\xampp\htdocs\itstep\links\vendor\laravel\ui\src\UiCommand.php:41
   37|             return call_user_func(static::$macros[$this->argument('type')], $this);
   38|         }
   39|
   40|         if (! in_array($this->argument('type'), ['bootstrap', 'vue', 'react'])) {
 > 41|             throw new InvalidArgumentException('Invalid preset.');
   42|         }
   43|
   44|         $this->{$this->argument('type')}();
   45|

 1   C:\xampp\htdocs\itstep\links\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36
     Laravel\Ui\UiCommand::handle()

 2   C:\xampp\htdocs\itstep\links\vendor\laravel\framework\src\Illuminate\Container\Util.php:37
     Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()´´´
Activity icon

Started a new Conversation Php Artisan Preset Don't Work Installing A Template.



  Command "preset" is not defined.´´´


Laravel Version: 7.X
Activity icon

Replied to Error Installing Laravel/ui.

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.´´´
Activity icon

Replied to Error Installing Laravel/ui.

Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!

   LogicException

  Unable to prepare route [api/user] for serialization. Uses Closure.

  at C:\xampp\htdocs\itstep\links\vendor\laravel\framework\src\Illuminate\Routing\Route.php:1150
    1146|      */
    1147|     public function prepareForSerialization()
    1148|     {
    1149|         if ($this->action['uses'] instanceof Closure) {
  > 1150|             throw new LogicException("Unable to prepare route [{$this->uri}] for serialization. Uses Closure.");
    1151|         }
    1152|
    1153|         $this->compileRoute();
    1154|

  1   C:\xampp\htdocs\itstep\links\vendor\laravel\framework\src\Illuminate\Foundation\Console\RouteCacheCommand.php:62
      Illuminate\Routing\Route::prepareForSerialization()

  2   C:\xampp\htdocs\itstep\links\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36
      Illuminate\Foundation\Console\RouteCacheCommand::handle()´´´
Activity icon

Replied to Error Installing Laravel/ui.

    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5|^8.0",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.0",
        "laravel/tinker": "^2.5"
      },
    "require-dev": {
        "facade/ignition": "^2.3.6",
        "fakerphp/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.0"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\": "app/",
            "LaravelFrontendPresets\ArgonPreset\": "presets/argon/src"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/",
            "LaravelFrontendPresets\ArgonPreset\": "presets/argon/src"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}´´´
Activity icon

Replied to Error Installing Laravel/ui.

Thanks for you're help, but it still didn't work..

C:\xampp\htdocs\itstep\links>composer require laravel/ui:^2.4 ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

  - The requested package laravel/framework (locked at v7.30.0, required as ^8.0) is satisfiable by laravel/framework[v7.30.0] but these conflict with your requirements or minimum-stability.
Problem 2
  - The requested package nunomaduro/collision (locked at v4.3.0, required as ^5.0) is satisfiable by nunomaduro/collision[v4.3.0] but these conflict with your requirements or minimum-stability.
Problem 3
  - Conclusion: don't install laravel/framework v8.18.1
  - Conclusion: don't install laravel/framework v8.18.0
  - Conclusion: don't install laravel/framework v8.17.2
  - Conclusion: don't install laravel/framework v8.17.1
  - Conclusion: don't install laravel/framework v8.17.0
  - Conclusion: don't install laravel/framework v8.16.1
  - Conclusion: don't install laravel/framework v8.16.0
  - Conclusion: don't install laravel/framework v8.15.0
  - Conclusion: don't install laravel/framework v8.14.0
  - Conclusion: don't install laravel/framework v8.13.0
  - Conclusion: don't install laravel/framework v8.12.3
  - Conclusion: don't install laravel/framework v8.12.2
  - Conclusion: don't install laravel/framework v8.12.1
  - Conclusion: don't install laravel/framework v8.12.0
  - Conclusion: don't install laravel/framework v8.11.2
  - Conclusion: don't install laravel/framework v8.11.1
  - Conclusion: don't install laravel/framework v8.11.0
  - Conclusion: don't install laravel/framework v8.10.0
  - Conclusion: don't install laravel/framework v8.9.0
  - Conclusion: don't install laravel/framework v8.8.0
  - Conclusion: don't install laravel/framework v8.7.1
  - Conclusion: don't install laravel/framework v8.7.0
  - Conclusion: don't install laravel/framework v8.6.0
  - Conclusion: don't install laravel/framework v8.5.0
  - Conclusion: don't install laravel/framework v8.4.0
  - Conclusion: don't install laravel/framework v8.3.0
  - Conclusion: don't install laravel/framework v8.2.0
  - Conclusion: don't install laravel/framework v8.1.0
  - Conclusion: don't install laravel/framework v8.0.4
  - Conclusion: don't install laravel/framework v8.0.3
  - Conclusion: don't install laravel/framework v8.0.2
  - Installation request for laravel/ui 2.4 -> satisfiable by laravel/ui[v2.4.0].
  - Conclusion: don't install laravel/framework v8.0.1
  - Conclusion: don't install laravel/framework v8.0.0
  - laravel/ui v2.4.0 requires illuminate/filesystem ^7.0 -> satisfiable by laravel/framework[v7.30.0], illuminate/filesystem[7.x-dev, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.10.0, v7.10.1, v7.10.2, v7.10.3, v7.11.0, v7.12.0, v7.13.0, v7.14.0, v7.14.1, v7.15.0, v7.16.0, v7.16.1, v7.17.0, v7.17.1, v7.17.2, v7.18.0, v7.19.0, v7.19.1, v7.2.0, v7.2.1, v7.2.2, v7.20.0, v7.21.0, v7.22.0, v7.22.1, v7.22.2, v7.22.3, v7.22.4, v7.23.0, v7.23.1, v7.23.2, v7.24.0, v7.25.0, v7.26.0, v7.26.1, v7.27.0, v7.28.0, v7.28.1, v7.28.2, v7.28.3, v7.28.4, v7.29.0, v7.29.1, v7.29.2, v7.29.3, v7.3.0, v7.30.0, v7.4.0, v7.5.0, v7.5.1, v7.5.2, v7.6.0, v7.6.1, v7.6.2, v7.7.0, v7.7.1, v7.8.0, v7.8.1, v7.9.0, v7.9.1, v7.9.2].
  - Can only install one of: laravel/framework[8.x-dev, v7.30.0].
  - don't install illuminate/filesystem 7.x-dev|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.0.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.0.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.0.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.0.3|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.0.4|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.0.5|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.0.6|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.0.7|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.0.8|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.1.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.1.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.1.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.1.3|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.10.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.10.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.10.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.10.3|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.11.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.12.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.13.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.14.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.14.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.15.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.16.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.16.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.17.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.17.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.17.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.18.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.19.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.19.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.2.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.2.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.2.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.20.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.21.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.22.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.22.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.22.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.22.3|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.22.4|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.23.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.23.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.23.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.24.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.25.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.26.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.26.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.27.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.28.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.28.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.28.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.28.3|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.28.4|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.29.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.29.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.29.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.29.3|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.3.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.30.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.4.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.5.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.5.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.5.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.6.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.6.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.6.2|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.7.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.7.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.8.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.8.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.9.0|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.9.1|don't install laravel/framework 8.x-dev
  - don't install illuminate/filesystem v7.9.2|don't install laravel/framework 8.x-dev
  - Installation request for laravel/framework ^8.0 -> satisfiable by laravel/framework[8.x-dev, v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0, v8.10.0, v8.11.0, v8.11.1, v8.11.2, v8.12.0, v8.12.1, v8.12.2, v8.12.3, v8.13.0, v8.14.0, v8.15.0, v8.16.0, v8.16.1, v8.17.0, v8.17.1, v8.17.2, v8.18.0, v8.18.1, v8.2.0, v8.3.0, v8.4.0, v8.5.0, v8.6.0, v8.7.0, v8.7.1, v8.8.0, v8.9.0].


Installation failed, reverting ./composer.json to its original content.´´´
Activity icon

Started a new Conversation Error Installing Laravel/ui.

Using version ^3.1 for laravel/ui
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package laravel/framework (locked at v7.30.0, required as ^8.0) is satisfiable by laravel/framework[v7.30.0] but these conflict with your requirements or minimum-stability.
  Problem 2
    - The requested package nunomaduro/collision (locked at v4.3.0, required as ^5.0) is satisfiable by nunomaduro/collision[v4.3.0] but these conflict with your requirements or minimum-stability.
  Problem 3
    - Conclusion: don't install laravel/framework v8.18.1
    - Conclusion: don't install laravel/framework v8.18.0
    - Conclusion: don't install laravel/framework v8.17.2
    - Conclusion: don't install laravel/framework v8.17.1
    - Conclusion: don't install laravel/framework v8.17.0
    - Conclusion: don't install laravel/framework v8.16.1
    - Conclusion: don't install laravel/framework v8.16.0
    - Conclusion: don't install laravel/framework v8.15.0
    - Conclusion: don't install laravel/framework v8.14.0
    - Conclusion: don't install laravel/framework v8.13.0
    - Conclusion: don't install laravel/framework v8.12.3
    - Conclusion: don't install laravel/framework v8.12.2
    - Conclusion: don't install laravel/framework v8.12.1
    - Conclusion: don't install laravel/framework v8.12.0
    - Conclusion: don't install laravel/framework v8.11.2
    - Conclusion: don't install laravel/framework v8.11.1
    - Conclusion: don't install laravel/framework v8.11.0
    - Conclusion: don't install laravel/framework v8.10.0
    - Conclusion: don't install laravel/framework v8.9.0
    - Conclusion: don't install laravel/framework v8.8.0
    - Conclusion: don't install laravel/framework v8.7.1
    - Conclusion: don't install laravel/framework v8.7.0
    - Conclusion: don't install laravel/framework v8.6.0
    - Conclusion: don't install laravel/framework v8.5.0
    - Conclusion: don't install laravel/framework v8.4.0
    - Conclusion: don't install laravel/framework v8.3.0
    - Conclusion: don't install laravel/framework v8.2.0
    - Conclusion: don't install laravel/framework v8.1.0
    - Conclusion: don't install laravel/framework v8.0.4
    - Conclusion: don't install laravel/framework v8.0.3
    - Conclusion: don't install laravel/framework v8.0.2
    - Conclusion: don't install laravel/framework v8.0.1
    - Conclusion: don't install laravel/framework v8.0.0
    - Conclusion: remove dragonmantank/cron-expression v2.3.1
    - Installation request for laravel/framework ^8.0 -> satisfiable by laravel/framework[8.x-dev, v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0, v8.10.0, v8.11.0, v8.11.1, v8.11.2, v8.12.0, v8.12.1, v8.12.2, v8.12.3, v8.13.0, v8.14.0, v8.15.0, v8.16.0, v8.16.1, v8.17.0, v8.17.1, v8.17.2, v8.18.0, v8.18.1, v8.2.0, v8.3.0, v8.4.0, v8.5.0, v8.6.0, v8.7.0, v8.7.1, v8.8.0, v8.9.0].
    - Conclusion: don't install dragonmantank/cron-expression v2.3.1
    - laravel/framework 8.x-dev requires dragonmantank/cron-expression ^3.0.2 -> satisfiable by dragonmantank/cron-expression[v3.0.2, v3.1.0].
    - Can only install one of: dragonmantank/cron-expression[v3.0.2, v2.3.1].
    - Can only install one of: dragonmantank/cron-expression[v3.1.0, v2.3.1].
    - Installation request for dragonmantank/cron-expression (locked at v2.3.1) -> satisfiable by dragonmantank/cron-expression[v2.3.1].

Installation failed, reverting ./composer.json to its original content.´´´
Oct
09
4 months ago
Activity icon

Replied to Read And Filter From Blade File

Thanks for your help, now I want to save the ids in my DB, do you know any way to do that?

Activity icon

Replied to Read And Filter From Blade File

I'm going to create records in a table that I want to assign to a blank spaces (div) in a blade.

I don't want to create a fixed record of the spaces I have.

To do that I need to read the blade file (.PHP) to know what names/id I have created there, this way avoiding the need to have a secondary table with that data.

The blank spaces I'm going to create are variable in its position in the page and the number of spaces created, so that I can have a more dynamic way of showing data in the blade.

Sumarizing, what I want is to get the id / name of the divs in a blade file (.PHP) in a diferent blade/controller into an array .

Activity icon

Replied to Read And Filter From Blade File

I am creating a blade file with empty spaces (div) that have specific id/name.

I want to know the names/ids I have created in that blade file in a different blade/view/controller so that I can use the names/ids for data assignement in later use.

Oct
08
5 months ago
Activity icon

Replied to Read And Filter From Blade File

I dont know the names/id from the blade div spaces.

What I want is to get them from the blade file, not the other way arround.

Activity icon

Replied to Read And Filter From Blade File

I will create a blade with this:

      ... PHP Code
 <div id = 'dataspace1' name = 'dataspace1' > </div>
         .. PHP Code
<div id = 'dataspace2' name = 'dataspace2' > </div>
         ... PHP Code    
<div id = 'dataspace3' name = 'dataspace3' > </div>
         ... PHP Code

What I need is to read the names/id from the divs from the blade.

Activity icon

Replied to Read And Filter From Blade File

I'm still working on it but it should be anything like:

<div class = 'class' name = divname id=divid>

Oct
06
5 months ago
Activity icon

Replied to Read And Filter From Blade File

I'm going to create a blade with predifined spaces for dynamic data append.

I've a table with the data foreach space (div).

When I insert data in the table I need to identify the name or id for the predifined spaces, so that the user can choose the space where the data will be shown.

Activity icon

Replied to Read And Filter From Blade File

I dont have any code right now..

What I have is a DB table where the menus are stored and a DB table with the views , I associate the menu with the blade by a parameter and I want when I tner that menu to create a blade with the inputs that correspond to the parameter.

Activity icon

Replied to Read And Filter From Blade File

Understood, but that solution isn't what I need for my app.

I need to fill the div with fields pre-fabricated to make it dynamic.

Activity icon

Replied to Read And Filter From Blade File

I want to use that div names/ids to insert there inputs pre-selected for that div by a given parameter.

Activity icon

Started a new Conversation Read And Filter From Blade File

Hello,

I'm wondering if it's possible to read the code of a blade file and ientify the divs names/ids.

Sep
17
5 months ago
Activity icon

Replied to CSFR Token Not Working.

I type it like that, I don't know why it isn't working

Activity icon

Started a new Conversation CSFR Token Not Working.

Whwn useing @csfr on my blades it's gets printed in the screen and on form actions keep expiring pages.