PaulCatalin97

PaulCatalin97

Member Since 2 Months Ago

Experience Points 1,590
Experience Level 1

3,410 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 0
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

06 Jul
2 weeks ago

PaulCatalin97 started a new conversation C# Make An Class "employee" With The Atributes "name" And "salary"

can someone show me some examples with this class of constructors, methods and overload ??

define 2 employee and for the first one to rais the salary, then display the employees.

i`m very new to programming, i want to learn c# and i want to know if i started right

using System;

namespace ConsoleApp1
{
    class employee
    {
        public string name{ get; set; }
        private double Salary;
        public double salary
        {
            get { return Salary; }

            set
            {
                Salary= value;
                if (Salary< 0) Salary= 0;
            }

        }
        // constructor de clasa
        public employee(string _name= "Neinitializat", double _salary= 0)
        {
           
            salary= _salary;
            name = _name;
        }
        //constructor de copiere
        public produs (produs s)
        {
            salary= s.salary;
            nsme = s.name;
        }

        public void citire()
        {
            Console.WriteLine("NAme:"); name = Console.ReadLine(); 
           Console.WriteLine("Salary:");Salary=double.Parse(Console.ReadLine()); 
        }
        public void scriere()
        {
            Console.WriteLine(name + ","  + Salary);
        }
    };
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
}

03 Jul
3 weeks ago

PaulCatalin97 started a new conversation Uncaught Error: Graph Container Element Not Found I Dont Know Why

i have this minor issue, why do i get this error? https://imgur.com/a/Zmn8h1z

(function() {
    var a, b, c, d, e = [].slice, f = function(a, b) { ----> this is the yellow one
        return function() {
            return a.apply(b, arguments)
        }
b.Grid = function(c) {
        function d(b) {
            this.resizeHandler = f(this.resizeHandler, this);
            var c = this;
            if (this.el = "string" == typeof b.element ? a(document.getElementById(b.element)) : a(b.element),
            null == this.el || 0 === this.el.length)
                throw new Error("Graph container element not found");----> this is the error
            "static" === this.el.css("position") && this.el.css("position", "relative"),
            this.options = a.extend({}, this.gridDefaults, this.defaults || {}, b),
            "string" == typeof this.options.units && (this.options.postUnits = b.units),
            this.raphael = new Raphael(this.el[0]),
            this.elementWidth = null,
            this.elementHeight = null,

i dont know jquery... i reviewed other errors and they say to move the javascript after mirror.js div

    <script src="{{ asset('plugins/jQuery/jQuery-2.1.3.min.js') }}"></script>
    <!-- jQuery UI 1.11.2 -->
    <script src="{{ asset('http://code.jquery.com/ui/1.11.2/jquery-ui.min.js') }}" type="text/javascript"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
      $.widget.bridge('uibutton', $.ui.button);
    </script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="{{ asset('bootstrap/js/bootstrap.min.js') }}" type="text/javascript"></script>    
    <!-- Morris.js charts -->
    <script src="{{ asset('http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js') }}"></script>
    <script src="{{ asset('plugins/morris/morris.min.js') }}" type="text/javascript"></script>
    <!-- Sparkline -->
    <script src="{{ asset('plugins/sparkline/jquery.sparkline.min.js') }}" type="text/javascript"></script>
    <!-- jvectormap -->
    <script src="{{ asset('plugins/jvectormap/jquery-jvectormap-1.2.2.min.js') }}" type="text/javascript"></script>
    <script src="{{ asset('plugins/jvectormap/jquery-jvectormap-world-mill-en.js') }}" type="text/javascript"></script>
    <!-- jQuery Knob Chart -->
    <script src="{{ asset('plugins/knob/jquery.knob.js') }}" type="text/javascript"></script>
    <!-- daterangepicker -->
    <script src="{{ asset('plugins/daterangepicker/daterangepicker.js') }}" type="text/javascript"></script>
    <!-- datepicker -->
    <script src="{{ asset('plugins/datepicker/bootstrap-datepicker.js') }}" type="text/javascript"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="{{ asset('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js') }}" type="text/javascript"></script>
    <!-- iCheck -->
    <script src="{{ asset('plugins/iCheck/icheck.min.js') }}" type="text/javascript"></script>
    <!-- Slimscroll -->
    <script src="{{ asset('plugins/slimScroll/jquery.slimscroll.min.js') }}" type="text/javascript"></script>
    <!-- FastClick -->
    <script src="{{ asset('plugins/fastclick/fastclick.min.js') }}"></script>
    <!-- AdminLTE App -->
    <script src="{{ asset('dist/js/app.min.js') }}" type="text/javascript"></script>

    <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
    <script src="{{ asset('dist/js/pages/dashboard.js') }}" type="text/javascript"></script>
    <script src="{{ asset('js/select-chosen.js') }}" type="text/javascript"></script>


    <!-- AdminLTE for demo purposes -->
    <script src="{{ asset('dist/js/demo.js') }}" type="text/javascript"></script>

  </body>

what do i have to change here? i don`t really know what to move... as i said, i don't know jquery or js, i'm new and this is my first project

01 Jul
3 weeks ago

PaulCatalin97 started a new conversation How To Find Storage Directory Cpanel/filezilla

i want to show an image previously uploaded in the database from a project that has been hosted with filezilla, the directory pathin filezilla and cpanel is like this /public_html/\imagineprofil

when I was using localhost, I used this

src="{{asset('/imagineprofil/'.$profileimage->image)}}"

to show the image from the directory

if i change the path to \imagineprofil , does not work

PaulCatalin97 started a new conversation Call To A Member Function Sortable() On Array

so i have this table to show datas from 3 tables joined, how can i use sortable in this situation? $candidat = DB::SELECT('select p.id, p.first_name, p.last_name, p.phone, p.cv , j.id, j.titlu , jp.id, jp.id_job, jp.id_profile, jp.created_at, jp.created_at as data_aplicare, se.name as skill, j.id_skill as aptitudine_necesara from job_to_profile jp inner join joburi j on j.id = jp.id_job inner join profile_employee p on p.id = jp.id_profile inner join skill_toprofile sp on sp.id_profile = p.id inner join skills_employee se on se.id = sp.id_skill')->sortable()->paginate(15);

PaulCatalin97 started a new conversation Method Illuminate\Database\Eloquent\Collection::appends Does Not Exist

this is what i use

 {{ $joburi->appends(\Request::except('page'))->render() }}

and this is my controller

<?php

namespace App\Http\Controllers\Auth;

use Auth;
use App\Models\Joburi;
use App\Models\SkillsEmployee;
use App\Models\ProfileEmployee;
use App\Models\ProfileEmployer;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class JoburiController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }
    public function index()
    {
        {
            $joburi = Joburi::where('activ', 1)->limit(15)->get();
            $skill = SkillsEmployee::all();
            $employerimage = ProfileEmployer::where('uid', Auth::user()->id)->first();
            $profileimage = ProfileEmployee::where('uid', Auth::user()->id)->first();
            return view('joburiactive', compact('joburi', 'skill', 'employerimage', 'profileimage'));
        }
    }

in other controller works with no problem

does anyone know why do i get this error?

PaulCatalin97 left a reply on Call To A Member Function Sortable() On Array

my life yould be easier i someone explained me that. I`m a begginer, not an expert to understand that documentation made specificly for an senior

PaulCatalin97 started a new conversation Call To A Member Function Sortable() On Array

so i have this table to show datas from 3 tables joined, how can i use sortable in this situation?

$candidat = DB::SELECT('select p.id, p.first_name, p.last_name, p.phone, p.cv , j.id, j.titlu , jp.id, jp.id_job, jp.id_profile, jp.created_at, jp.created_at as data_aplicare, se.name as skill, j.id_skill as aptitudine_necesara 
                                            from job_to_profile jp 
                                            inner join joburi j on j.id = jp.id_job 
                                            inner join profile_employee p on p.id = jp.id_profile 
                                            inner join skill_toprofile sp on sp.id_profile = p.id
                                            inner join skills_employee se on se.id = sp.id_skill')->sortable()->paginate(15);
28 Jun
3 weeks ago

PaulCatalin97 started a new conversation SELECT From Three Tables

I have three tables:

profile_employee -id -first_name -last_name -phone -cv

joburi -id -titlu

job_to_profile -id -id_job id_profile created_at

i want to select all of the information from all those three tables, i have this query but selects only first,last,phone,cv:

SELECT jtp.id, jtp.created_at as data_aplicare, profile_employee.first_name, profile_employee.last_name, profile_employee.phone, profile_employee.cv FROM profile_employee LEFT JOIN job_to_profile jtp ON jtp.id_profile = profile_employee.id

If been through a load of answers here and still tearing my hair out to get the results I need. Can any SQL gurus out there see a simple solution. The potential JOINs required are frying my brain.

Any help would be much appreciated. For the sake of my scalp, among other things ;)

PaulCatalin97 left a reply on Directory Path

doesnt work...

PaulCatalin97 started a new conversation Directory Path

Ok, so i have a small problem. I use Filezilla to host my site, my images appear offline, but not online

i try to show images from specific directory like \cv or \imagineprofil where they upload on site and on host https://imgur.com/a/vSKUg7J

11 Jun
1 month ago

PaulCatalin97 left a reply on How To Multiple Action="" ?

@CRONIX - im new in laravel and i implemented the mailable, but i didn`t know i can use it in other controller than the created one

PaulCatalin97 left a reply on How To Multiple Action="" ?

mm... i need to insert the data in table to be used furthere. i have an aplication web site, where you can apply for jobs, when you apply it inserts data in a new table and i want to be notified when someone applies

PaulCatalin97 started a new conversation How To Multiple Action="" ?

is there a way to multiple action in a html form?

i have a submit button that sends data in database but i want that button to send an email that the data is sent and i need a form for both

10 Jun
1 month ago

PaulCatalin97 started a new conversation Undefined Index: Titlu

titlu exists in Joburi, why does give me this error ?


        $numejob = Joburi::all();
        $responses = JobToProfile::with('id_job', $numejob->first()->titlu);

PaulCatalin97 started a new conversation Property [titlu] Does Not Exist On This Collection Instance.

does anyone know why do i get this error?

$numejob = Joburi::all();
        $responses = JobToProfile::where('id_job', $numejob->titlu)->get();

PaulCatalin97 started a new conversation Fetching Data To View

ok so i have a table that fills when a users selects an job with id_profile and id_job

i want in my view to show the jobs that the user selected but with the name from the table that provides the job

can i do something like that

  $joburi = JobToProfile::all()->where(id_job as 'title');

PaulCatalin97 left a reply on View Problem

@JLRDW - hai mersi mult, ce pot sa spun

PaulCatalin97 started a new conversation View Problem

ok so i have a table that fills when a users selects an job with id_profile and id_job

i want in my view to show the jobs that the user selected but with the name from the table that provides the job

can i do something like that

  $joburi = JobToProfile::all()->where(id_job as 'title');

PaulCatalin97 started a new conversation Inner Join 3 Tables

i have a table special for id_profile and id_job

i want to insert the id for job that one id profile have selected.

table job_to_profile

protected $fillable = [
        'id', 'id_profile', 'id_job',
    ];

table joburi

protected $fillable = [
        'id', 'titlu', 'descriere', 'salariu_estimativ', 'oras', 'id_skill', 'activ',
    ];

table profileemployee

protected $fillable = [
        'id', 'uid', 'first_name', 'last_name','phone', 'cv', 'image', 'address', 'city',
    ];

how can i do that with inner join ?

21 May
2 months ago

PaulCatalin97 started a new conversation Fata Error, Test_input

if (empty($_POST["email"])) {
 $emailErr = "Email obligatoriu";
} else {
 $email = test_input($_POST["email"]);
 // check if e-mail address is well-formed
 if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
  $emailErr = "Forma invalida email";
 }
}

so, i want to check if an email is well-formed, and tells me this

PaulCatalin97 started a new conversation Undefined Index: Id, Image, Name, Price

does anybody know why do i get this error ?

this is the error file

<?php

//fetch_item.php

include"conexiune.php";

$query = "SELECT * FROM tbl_product ORDER BY id DESC";

$statement = $con->prepare($query);

if($statement->execute())
{
    $resultSet = $statement->get_result();
    $result = $resultSet->fetch_all();
    $output = '';
    foreach($result as $row)
    {
        $output .= '
  <div class="col-md-3" style="margin-top:12px;margin-bottom:12px;">  
            <div style="border:1px solid #ccc; border-radius:5px; padding:16px; height:300px;" align="center" id="product_id'.$row["id"].'">
             <img src="C:\xampp\htdocs\proiectPHP\images'.$row["image"].'" class="img-responsive" /><br />
             <h4 class="text-info">
                        <div class="checkbox">
                              <label><input type="checkbox" class="select_product" data-product_id="'.$row["id"].'" data-product_name="'.$row["name"].'" data-product_price="'.$row["price"] .'" value="">'.$row["name"].'</label>
                        </div>
                  </h4>
             <h4 class="text-danger">$ '.$row["price"] .'</h4>
            </div>
        </div>
  ';
    }
    echo $output;
}

and this is my action file

<?php

//action.php

session_start();

if(isset($_POST["action"]))
{
    if($_POST["action"] == "add")
    {
        $product_id = $_POST["product_id"];
        $product_name = $_POST["product_name"];
        $product_price = $_POST["product_price"];
        for($count = 0; $count < count($product_id); $count++)
        {
            $cart_product_id = array_keys($_SESSION["shopping_cart"]);
            if(in_array($product_id[$count], $cart_product_id))
            {
                $_SESSION["shopping_cart"][$product_id[$count]]['product_quantity']++;
            }
            else
            {
                $item_array = array(
                    'product_id'               =>     $product_id[$count],
                    'product_name'             =>     $product_name[$count],
                    'product_price'            =>     $product_price[$count],
                    'product_quantity'         =>     1
                );

                $_SESSION["shopping_cart"][$product_id[$count]] = $item_array;


            }
        }
    }

    if($_POST["action"] == 'remove')
    {
        foreach($_SESSION["shopping_cart"] as $keys => $values)
        {
            if($values["product_id"] == $_POST["product_id"])
            {
                unset($_SESSION["shopping_cart"][$keys]);
            }
        }
    }
    if($_POST["action"] == 'empty')
    {
        unset($_SESSION["shopping_cart"]);
    }
}


PaulCatalin97 left a reply on Undefined Index: Id,image,name,price

this is my action.php

<?php

//action.php

session_start();

if(isset($_POST["action"]))
{
    if($_POST["action"] == "add")
    {
        $product_id = $_POST["product_id"];
        $product_name = $_POST["product_name"];
        $product_price = $_POST["product_price"];
        for($count = 0; $count < count($product_id); $count++)
        {
            $cart_product_id = array_keys($_SESSION["shopping_cart"]);
            if(in_array($product_id[$count], $cart_product_id))
            {
                $_SESSION["shopping_cart"][$product_id[$count]]['product_quantity']++;
            }
            else
            {
                $item_array = array(
                    'product_id'               =>     $product_id[$count],
                    'product_name'             =>     $product_name[$count],
                    'product_price'            =>     $product_price[$count],
                    'product_quantity'         =>     1
                );

                $_SESSION["shopping_cart"][$product_id[$count]] = $item_array;


            }
        }
    }

    if($_POST["action"] == 'remove')
    {
        foreach($_SESSION["shopping_cart"] as $keys => $values)
        {
            if($values["product_id"] == $_POST["product_id"])
            {
                unset($_SESSION["shopping_cart"][$keys]);
            }
        }
    }
    if($_POST["action"] == 'empty')
    {
        unset($_SESSION["shopping_cart"]);
    }
}

?>

PaulCatalin97 left a reply on Undefined Index: Id,image,name,price

@SERGIU17 - yes, it is an array : array(4) { [0]=> int(3) [1]=> string(18) "Panasonic T44 Lite" [2]=> string(5) "3.jpg" [3]=> float(125) }

PaulCatalin97 started a new conversation Undefined Index: Id,image,name,price

<?php

//fetch_item.php

include"conexiune.php";

$query = "SELECT * FROM tbl_product ORDER BY id DESC";

$statement = $con->prepare($query);

if($statement->execute())
{
    $resultSet = $statement->get_result();
    $result = $resultSet->fetch_all();
    $output = '';
    foreach($result as $row)
    {
        $output .= '
  <div class="col-md-3" style="margin-top:12px;margin-bottom:12px;">  
            <div style="border:1px solid #ccc; border-radius:5px; padding:16px; height:300px;" align="center" id="product_'.$row["id"].'">
             <img src="C:\xampp\htdocs\proiectPHP\images'.$row["image"].'" class="img-responsive" /><br />
             <h4 class="text-info">
                        <div class="checkbox">
                              <label><input type="checkbox" class="select_product" data-product_id="'.$row["id"].'" data-product_name="'.$row["name"].'" data-product_price="'.$row["price"] .'" value="">'.$row["name"].'</label>
                        </div>
                  </h4>
             <h4 class="text-danger">$ '.$row["price"] .'</h4>
            </div>
        </div>
  ';
    }
    echo $output;
}

who has aclue why i get this error ?

19 May
2 months ago

PaulCatalin97 left a reply on Laravel 5.8 Delete/destroy Id From Database

@CRONIX - by doing your changes, tells me this: Missing required parameters for [Route: listajoburi.update] [URI: listajoburi/update/{id}]

18 May
2 months ago

PaulCatalin97 started a new conversation Laravel 5.8 Delete/destroy Id From Database

how can be done? i can`t find any solution on documentation.

this is the controller

public function destroy ($id)
    {
        Joburi::destroy($id);
        return redirect()->route('listajoburi.update');
    }

this is the button

<a href="{{route('listajoburi.destroy',$row['id'])}}" class="btn btn-danger">Delete</a>
                            <form method="post" class="delete_form" action="{{route('listajoburi.destroy',$row['id'])}}">
                                @method('DESTROY')
                                <input type="hidden" name="_token" value="@csrf">
                            </form>

and this is the route

Route::post('/listajoburi/{id}/', 'Auth\[email protected]')->name('listajoburi.destroy');

PaulCatalin97 left a reply on How To Update And Edit A Image In Laravel 5.8

routes

Route::get('/imageupload', 'Auth\[email protected]')->name('imageupload');
Route::post('/imageuploadupdate', 'Auth\[email protected]')->name('imageupload.update');

PaulCatalin97 left a reply on How To Update And Edit A Image In Laravel 5.8

this worked for me

class ImageUploadController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }
    public function index()
    {
        $profileimage = ProfileEmployee::where('uid', Auth::user()->id)->first();
        return view('imageupload', compact('profileimage'));
    }

    public function update(Request $request)
    {
        $request->validate([
            'image' => 'image|mimes:jpeg,png,jpg|max:2048'
        ]);
        $employee = ProfileEmployee::where('uid', Auth::user()->id)->first();

        if ($request->hasfile('image')){
            $file = $request->file('image');
            $extension = $file->getClientOriginalExtension();
            $filename = md5(time()).'.'.$extension;
            $file->move(public_path().'\imagineprofil',$filename);
            $employee->image=$filename;
        } else {
            return $request;
            $employee->image='';
        }

        if($employee->save()){
            return redirect()->route('imageupload')->withSuccess('S-a incarcat cu success!');
        }else{
            return redirect()->route('imageupload')->withDanger('Nu s-a incarcat! A aparut o eroare.');
        }
    }

}

PaulCatalin97 started a new conversation Missing Required Parameters For [Route: Listajoburi.update] [URI: Listajoburiupdate{id}].

i`m new to laravel, why do i get this error ? i have passed the parameters.

this is the blade file

 <form action="{{route('listajoburi.update', $id)}}" method="post" enctype="multipart/form-data">
                @csrf
                <div class="box-body">
                    <div class="form-group">
                        <label for="exampleInputEmail1">Nume Job</label>
                        <input type="text" class="form-control" id="titlu" name="titlu" value="{{$joburi->titlu}}"/>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputPassword1">Descriere:</label>
                        <input type="text" class="form-control" id="descriere" name="descriere" value="{{$joburi->descriere}}"/>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputPassword1">Salariu Estimativ:</label>
                        <input type="text" class="form-control" id="salariu_estimativ" name="salariu_estimativ" value="{{$joburi->salariu_estimativ}}"/>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputPassword1">Oras:</label>
                        <input type="text" class="form-control" id="oras" name="oras" value="{{$joburi->oras}}"/>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputPassword1">Activ(1=activ,0=inactiv)</label>
                        <input type="text" class="form-control" id="activ" name="ativ" value="{{$joburi->activ}}">
                    </div>

this is the controller

public function index()
    {
        $joburi = Joburi::all()->toArray();
        return view('listajoburi', compact('joburi'));
    }

    public function edit($id)
    {
        $joburi = Joburi::find($id);
        return view('editarejob', compact('joburi', 'id'));
    }

    public function update(Request $request, $id)
    {
        $this->validator($request->all());

        $update = Joburi::find($id)->update([
            'titlu' => $request->titlu,
            'descriere' => $request->descriere,
            'salariu_estimativ' => $request->salariu_estimativ,
            'oras' => $request->oras,
            'activ' => $request->activ,
            //  'skill' => $request->city,
        ]);

        if ($update) {
            return redirect()->route('listajoburi.update')->withSuccess('S-a modificat cu success!');
        } else {
            return redirect()->back()->withDanger('Nu s-a modificat! A aparut o eroare.');
        }
    }

    protected function validator(array $data)
    {
        return Validator::make($data, [
            'titlu' => ['required', 'string', 'min:3', 'max:255'],
            'descriere' => ['required', 'string', 'max:11'],
            'salariu_estimativ' => ['required', ''],
            'oras' => ['string', 'max:512'],
            'activ' => ['required', 'string', 'max:512'],
            // 'skill' => ['string', 'max:45'],
        ]);

    }
}

and this is the route

Route::get('/listajoburi', 'Auth\[email protected]')->name('listajoburi');
Route::get('/editarejob/{id}/', 'Auth\[email protected]')->name('editarejob');
Route::post('/listajoburiupdate{id}/', 'Auth\[email protected]')->name('listajoburi.update');

15 May
2 months ago

PaulCatalin97 left a reply on Undefined Index

@TISUCHI - solved it, in the validation was the problem, de index was defined 'id_skill' and we tried to fill it the skill field

PaulCatalin97 left a reply on Undefined Index

@TISUCHI - same error...

PaulCatalin97 left a reply on Undefined Index

@TISUCHI - Undefined index: skills for this line->> $skills = $data['skills'];

@kima , both of them are id_skill, thx

PaulCatalin97 left a reply on Undefined Index

@TISUCHI - i updated with the full controller right now

PaulCatalin97 left a reply on Undefined Index

@TISUCHI - still the same error with your code

PaulCatalin97 left a reply on Undefined Index

@TISUCHI - and i have to change it in the create as skills[] ?

PaulCatalin97 started a new conversation Undefined Index

i`m trying to insert some data in model and i get this error

this is my form for this specific column

 <div class="dropdown-field">
                                    <select data-placeholder="Selecteaza Specializare" class="chosen" id="skills" name="skills" multiple="multiple">
                                        @foreach($skills as $skill)
                                            <option value="{{$skill->id}}" >{{strtoupper($skill->name)}}</option>
                                        @endforeach
                                    </select>
                                    <div class="box-footer">

and this is the controller

 public function store(Request $request)
    {
        $data = $request->validate([
            'titlu' => 'required|string|max:255',
            'descriere' => 'required|string|max:255',
            'salariu_estimativ' => 'required|string|max:255',
            'oras'=> 'required',
            'id_skill'=>'',

        ]);

        Joburi::create([
            'titlu' => $data['titlu'],
            'descriere' => $data['descriere'],
            'salariu_estimativ' => $data['salariu_estimativ'],
            'oras' => $data['oras'],
            'is_skill'=>$data['skills'],
        ]);
        if($data){
            return redirect()->route('adaugajob')->withSuccess('S-a incarcat cu success!');
        }else{
            return redirect()->route('adaugajob')->withDanger('Nu s-a incarcat! A aparut o eroare.');
        }
        }
    }

PaulCatalin97 left a reply on No Message Error

@NAKOV - i change it but i get the same message

PaulCatalin97 left a reply on No Message Error

@JHUMANJ - i do not know how to do that

PaulCatalin97 started a new conversation No Message Error

I really dont understand why, my route is post, method for form is post, why im getting this error ?

this is my route

Route::post('/adaugajob', 'Auth\[email protected]')->name('adaugajob');

This is my form

 <form action="{{route('adaugajob')}}" method="POST" enctype="multipart/form-data">
                            @csrf
                            <div class="box-body">
                                <div class="form-group">
                                    <label >Titlu Job:</label>
                                    <input type="text" class="form-control" id="titlu" name="titlu"/>
                                </div>
                                <div class="form-group">
                                    <label >Descriere:</label>
                                    <input type="text" class="form-control" id="descriere" name="descriere"/>
                                </div>
                                <div class="form-group">
                                    <label >Salariu Estimativ:</label>
                                    <input type="text" class="form-control" id="salariu_estimativ" name="salariu_estimativ" />
                                </div>
                                <div class="form-group">
                                    <label >Oras:</label>
                                    <input type="text" class="form-control" id="oras" name="oras" />
                                </div>
                                <div class="form-group">
                                    <label >Activ:</label>
                                    <input type="hidden" class="form-control" id="activ" name="activ" value="0">
                                </div>
                                <div class="dropdown-field">
                                    <select data-placeholder="Selecteaza Specializare" class="chosen" id="multiselect" name="skills[]" multiple="multiple">
                                        @foreach($skills as $skill)
                                            <option value="{{$skill->id}}" >{{strtoupper($skill->name)}}</option>
                                        @endforeach
                                    </select>
                                    <div class="box-footer">
                                        <button type="submit" class="btn btn-primary">Adauga</button>
                                    </div>
                                </div>
                            </div>
                        </form>

And This is my Controller for this form

class AdaugaJobController extends Controller
{

    public function __construct()
    {
        $this->middleware('auth');
    }

    public function index()
    {
        $skills = SkillsEmployee::all();
        return view('adaugajob', compact('skills'));
    }

    protected function validator(array $data)
    {

        if ($data) {
            return Validator::make($data, [
                'titlu' => ['required', 'string', 'max:255'],
                'descriere' => ['required', 'string', 'max:255'],
                'salariu_estimativ' => ['required', 'string', 'max:255'],
                'oras' => ['required', ''],
            ]);
        }
    }

    protected function create( \Illuminate\Http\Request $request)
    {
        $data = $request->all();
        if ($data) {
            Joburi::create([
                'titlu' => $data['titlu'],
                'descriere' => $data['descriere'],
                'salariu_estimativ' => $data['salariu_estimativ'],
                'oras' => $data['oras'],
            ]);
            foreach ($data['skills'] as $skill) {
                Joburi::create([
                    'id_skill' => $skill,
                ]);
            }
        }

    }
}

I want to insert the data from the form in a model. the model has the names of the fields in the form. nothing seems wrong. when it used to work it didn`t insert nothing, but now i get this NO MESSAGE error

PaulCatalin97 started a new conversation Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No Message Why?

I really dont understand why, my route is post, method for form is post, why im getting this error ?

this is my route

Route::post('/adaugajob', 'Auth\[email protected]')->name('adaugajob');

This is my form

 <form action="{{route('adaugajob')}}" method="POST" enctype="multipart/form-data">
                            @csrf
                            <div class="box-body">
                                <div class="form-group">
                                    <label >Titlu Job:</label>
                                    <input type="text" class="form-control" id="titlu" name="titlu"/>
                                </div>
                                <div class="form-group">
                                    <label >Descriere:</label>
                                    <input type="text" class="form-control" id="descriere" name="descriere"/>
                                </div>
                                <div class="form-group">
                                    <label >Salariu Estimativ:</label>
                                    <input type="text" class="form-control" id="salariu_estimativ" name="salariu_estimativ" />
                                </div>
                                <div class="form-group">
                                    <label >Oras:</label>
                                    <input type="text" class="form-control" id="oras" name="oras" />
                                </div>
                                <div class="form-group">
                                    <label >Activ:</label>
                                    <input type="hidden" class="form-control" id="activ" name="activ" value="0">
                                </div>
                                <div class="dropdown-field">
                                    <select data-placeholder="Selecteaza Specializare" class="chosen" id="multiselect" name="skills[]" multiple="multiple">
                                        @foreach($skills as $skill)
                                            <option value="{{$skill->id}}" >{{strtoupper($skill->name)}}</option>
                                        @endforeach
                                    </select>
                                    <div class="box-footer">
                                        <button type="submit" class="btn btn-primary">Adauga</button>
                                    </div>
                                </div>
                            </div>
                        </form>

And This is my Controller for this form

class AdaugaJobController extends Controller
{

    public function __construct()
    {
        $this->middleware('auth');
    }

    public function index()
    {
        $skills = SkillsEmployee::all();
        return view('adaugajob', compact('skills'));
    }

    protected function validator(array $data)
    {

        if ($data) {
            return Validator::make($data, [
                'titlu' => ['required', 'string', 'max:255'],
                'descriere' => ['required', 'string', 'max:255'],
                'salariu_estimativ' => ['required', 'string', 'max:255'],
                'oras' => ['required', ''],
            ]);
        }
    }

    protected function create( \Illuminate\Http\Request $request)
    {
        $data = $request->all();
        if ($data) {
            Joburi::create([
                'titlu' => $data['titlu'],
                'descriere' => $data['descriere'],
                'salariu_estimativ' => $data['salariu_estimativ'],
                'oras' => $data['oras'],
            ]);
            foreach ($data['skills'] as $skill) {
                Joburi::create([
                    'id_skill' => $skill,
                ]);
            }
        }

    }
}

I want to insert the data from the form in a model. the model has the names of the fields in the form. nothing seems wrong. when it used to work it didn`t insert nothing, but now i get this NO MESSAGE error

12 May
2 months ago

PaulCatalin97 left a reply on Uploading A File Error

@TRAY2 - Know that, was jus testing. I edited like that $file->move(public_path().'\cv',$filename);

PaulCatalin97 started a new conversation Uploading A File Error

So, I try to upload a file and shows me this error ! {"_token":"xBDlGKupDvKE3FPI84Eku5Kd6I6l5pKlRHs9LzCk","image":{}} what can i do to solve this ?

class UploadCvController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }
    public function index()
    {
        $profilecv = ProfileEmployee::where('uid', Auth::user()->id)->first();
        return view('uploadcv', compact('profilecv'));
    }

    public function update(Request $request)
    {
        $request->validate([
            'cv' => 'file', 'max:2048',
        ]);
        dd($request);
        $employeecv = ProfileEmployee::where('uid', Auth::user()->id)->first();

        if ($request->hasfile('cv')){
            $file = $request->file('cv');
            $extension = $file->getClientOriginalName();
            $filename = md5(time()).'.'.$extension;
            $file->move('C:\xampp\htdocs\apcjobs\public\cv',$filename);
            $employeecv->cv=$filename;
        } else {
            return $request;
            $employee->cv='';
        }
        $employeecv->save();

        if($employeecv){
            return redirect()->route('uploadcv')->withSuccess('S-a incarcat cu success!');
        }else{
            return redirect()->back()->withDanger('Nu s-a incarcat! A aparut o eroare.');
        }
    }

}

How can I convert the file or what can i do ? I dd($request) and says that i receive an image, but I upload a word.docx